MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / optimize

Method optimize

src/db/connection.rs:230–239  ·  view source on GitHub ↗

Runs VACUUM and ANALYZE to reclaim space and update query planner statistics.

(&self)

Source from the content-addressed store, hash-verified

228
229 /// Runs VACUUM and ANALYZE to reclaim space and update query planner statistics.
230 pub async fn optimize(&self) -> Result<()> {
231 self.conn
232 .execute_batch("VACUUM; ANALYZE;")
233 .await
234 .map_err(|e| TraceDecayError::Database {
235 message: format!("failed to optimize database: {e}"),
236 operation: "optimize".to_string(),
237 })?;
238 Ok(())
239 }
240
241 /// Returns the on-disk size of the database file in bytes.
242 pub async fn size(&self) -> Result<u64> {

Callers 2

check_databaseFunction · 0.45
test_optimizeFunction · 0.45

Calls

no outgoing calls

Tested by 1

test_optimizeFunction · 0.36