Add periodic WAL checkpointing to fix slow queries

The WAL file was growing to 700MB+ which caused COUNT(*) queries to
timeout. Reads must scan the WAL to find current page versions, and
a large WAL makes this slow.

Add Checkpoint method to database interface and run PASSIVE checkpoints
every 30 seconds via the DBMaintainer. This keeps the WAL small and
maintains fast read performance under heavy write load.
This commit is contained in:
2026-01-01 05:42:03 -08:00
parent c6fa2b0fbd
commit 8f524485f7
4 changed files with 65 additions and 7 deletions
@@ -415,6 +415,11 @@ func (m *mockStore) Analyze(ctx context.Context) error {
return nil
}
// Checkpoint mock implementation
func (m *mockStore) Checkpoint(ctx context.Context) error {
return nil
}
func TestRouteWatchLiveFeed(t *testing.T) {
// Create mock database