Skip to content

Commit 6f9eb81

Browse files
fix(doctor): analyze SQLite databases after offline compaction
1 parent dfa748f commit 6f9eb81

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎docs/cli/doctor.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ The command:
240240
`schema_meta.role = "global"` before checkpointing or changing the file.
241241
3. Requires a non-busy `wal_checkpoint(TRUNCATE)`. Stop any remaining OpenClaw
242242
process and retry if the checkpoint is busy.
243-
4. Sets `auto_vacuum` to `INCREMENTAL`, runs a full `VACUUM`, and checkpoints
244-
again.
243+
4. Sets `auto_vacuum` to `INCREMENTAL`, runs a full `VACUUM`, then refreshes
244+
SQLite planner statistics with `ANALYZE` and completes a final checkpoint.
245245
5. Runs `quick_check`, `integrity_check`, and `foreign_key_check`, then
246246
reapplies owner-only permissions to the database and SQLite sidecar files.
247247

@@ -315,8 +315,9 @@ expected target count; a nonexistent explicit store path selects no targets.
315315
SQLite deletes reclaim pages inside the database first; they do not necessarily
316316
shrink the database file immediately. After deleting or archiving large
317317
transcripts, run `openclaw doctor --session-sqlite compact --session-sqlite-all-agents`
318-
to checkpoint WAL files, run `VACUUM`, and report before/after database and WAL
319-
sizes. Compaction requires a regular file with the current agent schema, the
318+
to checkpoint WAL files, run `VACUUM`, refresh SQLite planner statistics with
319+
`ANALYZE`, complete a final checkpoint, and report before/after database and
320+
WAL sizes. Compaction requires a regular file with the current agent schema, the
320321
selected agent's durable owner metadata, and no open handle in the doctor
321322
process. The destructive `import`, `compact`, `recover`, and `restore` modes
322323
hold the same state ownership lock as Gateway startup for their full operation;

0 commit comments

Comments
 (0)