Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sqld/src/connection/libsql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,9 @@ impl<W: WalHook> Connection<W> {
let freelist_count = self
.conn
.query_row("PRAGMA freelist_count", (), |row| row.get::<_, i64>(0))?;
// NOTICE: don't bother vacuuming if we don't have at least 32MiB of data
if page_count >= 8192 && freelist_count * 2 > page_count {
tracing::debug!("Vacuuming: pages={page_count} freelist={freelist_count}");
// NOTICE: don't bother vacuuming if we don't have at least 256MiB of data
if page_count >= 65536 && freelist_count * 2 > page_count {
tracing::info!("Vacuuming: pages={page_count} freelist={freelist_count}");
self.conn.execute("VACUUM", ())?;
} else {
tracing::debug!("Not vacuuming: pages={page_count} freelist={freelist_count}");
Expand Down