GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(server): opening a large database no longer blocks startup for minutes by t3dotgg · Pull Request #21122 · pingdotgg/t3code Conversation
|
| Query | No stats | With stats | No stats + hint |
|---|---|---|---|
| ThreadFind revision | 9 to 3,205 ms | 0 ms | 0 ms |
| Turn-start node read | 0 to 28 ms | 0 ms | 0 ms |
| Thread text search | 1 to 126 ms | 1 to 173 ms | no change needed |
The no-stats plan depends only on the schema, so it is the same on every machine. I reviewed it for every location whose plan changed on any machine. I timed the risky ones on the largest database: agent event reads by thread, the startup recovery query, and thread search. None was slower without stats. Some, such as the provider-thread reads at ProjectionStore.ts:3139 and :3156, use an index only without stats.
This continues #19407 by @thymikee, whose commits are kept with his authorship. His PR seeded fixed sqlite_stat1 rows instead of collecting them. The fleet measurements showed that the stats themselves are not needed, so this branch removes them. His desktop menu fix is unchanged.
#19917 (hourly PRAGMA optimize) goes the other way and would bring the stats back.
optimize line, and it fails if the reload is missing.vp test run passes for Sqlite.test.ts, ProjectionStore.test.ts, ThreadFind.test.ts, TurnStartReads.test.ts, ProviderTurnControlService.test.ts, ProviderTurnStartService.test.ts and DesktopApplicationMenu.test.ts. Server and desktop typecheck pass. Lint and format pass on the changed files.Reviewed with sol-loop: 3 rounds with GPT-6.1 Sol. Sol verdict: approved
Original work by Michał Pierzchała with Claude Opus 5.5 in Claude Code. Takeover by Claude Opus 5.5 in Claude Code, working in T3 Code.
Co-authored-by: Michał Pierzchała [email protected]
🤖 Generated with Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — The PR changes the default SQLite planner policy for every server database, clears persisted statistics at startup, and alters query plans on existing request paths. The update-menu change is small, but the server-wide runtime default warrants human review. You can add or adjust custom eligibility rules. Learn more. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…nutes Opening a database without planner statistics ran PRAGMA optimize, which reads every page of the large tables: 3 min 47 s on a 48 GB database before the server could answer. Seed fixed sqlite_stat1 rows, measured on that database, for indexes that have none instead. Rows a database already has are kept. Check for Updates no longer opens the main window before the backend is ready, which left the renderer on a failed auth bootstrap. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The server and a CLI command can open a database without statistics at the same time. Each could read the same missing indexes before either inserted, and sqlite_stat1 has no unique key, so both rows stayed. The read and insert now share one BEGIN IMMEDIATE transaction. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Migration 063 dropped the V1 projection tables after this branch was written, so their seeded rows named indexes that no longer exist. Co-Authored-By: Michał Pierzchała <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d them Fleet measurements on 10 databases showed only two queries get slower without sqlite_stat1, and an INDEXED BY hint makes both as fast as with stats. Stats taken while a table is small also make the planner scan it once it grows. So drop the table on open instead of seeding fixed rows. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A connection loads sqlite_stat1 when it opens, so dropping the table left the writer planning with the old rows. Delete the rows and reload with ANALYZE sqlite_schema, which reads no user table. Co-Authored-By: Claude Opus 5.5 <[email protected]>
d414e5a to
425abfa
Compare
There was an error while loading. Please reload this page.
…nutes (pingdotgg#21122) Co-authored-by: Michał Pierzchała <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> (cherry picked from commit eb1d80c) Fork: replaces the hourly PRAGMA optimize adopted from pingdotgg#19917 (eb76cb8), which upstream closed as superseded by this change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…covered Upstream pingdotgg#21122 stops using planner statistics, so the fork's hourly PRAGMA optimize (from pingdotgg#19917) is gone and its test with it; the file now matches upstream. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks for getting this in, appreciate it! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
## What's Changed * perf(web): switching threads no longer re-renders the chat view for an unchanged preview list by @juliusmarminge in pingdotgg/t3code#21130 * fix(server): opening a large database no longer blocks startup for minutes by @t3dotgg in pingdotgg/t3code#21122 * perf(web): switching threads no longer re-renders the outgoing thread's rows by @juliusmarminge in pingdotgg/t3code#21123 * perf(web): reasoning rows skip the tool-failure text scan by @juliusmarminge in pingdotgg/t3code#21146 * perf(web): pull request chains parse each link's URL once by @juliusmarminge in pingdotgg/t3code#21147 **Full Changelog**: pingdotgg/t3code@v0.1.1-nightly.20261018.3302...v0.1.1-nightly.20261018.3315 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.1-nightly.20261018.3315
## What's Changed * perf(web): switching threads no longer re-renders the chat view for an unchanged preview list by @juliusmarminge in pingdotgg/t3code#21130 * fix(server): opening a large database no longer blocks startup for minutes by @t3dotgg in pingdotgg/t3code#21122 * perf(web): switching threads no longer re-renders the outgoing thread's rows by @juliusmarminge in pingdotgg/t3code#21123 * perf(web): reasoning rows skip the tool-failure text scan by @juliusmarminge in pingdotgg/t3code#21146 * perf(web): pull request chains parse each link's URL once by @juliusmarminge in pingdotgg/t3code#21147 **Full Changelog**: pingdotgg/t3code@v0.1.1-nightly.20261018.3302...v0.1.1-nightly.20261018.3315 Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.1-nightly.20261018.3315
…nutes (pingdotgg#21122) Co-authored-by: Michał Pierzchała <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> (cherry picked from commit eb1d80c)
…nutes (pingdotgg#21122) Co-authored-by: Michał Pierzchała <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> (cherry picked from commit eb1d80c)
…nutes (pingdotgg#21122) Co-authored-by: Michał Pierzchała <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Fork adaptation: Keep the fork's runAllMigrations entry point before clearing planner statistics so fork migrations and the V1 history-table renames still run before upstream drops the original tables. Replace the earlier fork sampling assertion with upstream's statistics-clearing and indexed-query-plan test because opening the database no longer collects statistics. (cherry picked from commit eb1d80c) Upstream-PR: 21122
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.