Repository navigation
Commit 39769cd
perf(server): read Antigravity usage in bounded pages
Cold or changed Antigravity databases were read with one statement.all()
per blob table, so every row was in memory and the event loop was blocked
until the whole table returned. Decoded usage maps also held subarray views
of each row blob, which kept every blob alive until the read finished.
Page gen_metadata, steps and trajectory_metadata_blob by rowid in groups
of 256 only for ordinary rowid tables with no index and no column named
rowid. Yield between pages inside the same read-only transaction. For
these tables, main's ORDER BY idx sorts a rowid-order scan, so a stable
sort by idx after paging returns the same order. Every other table runs
main's exact query as one read, preserving its results and order.
Read the rowid cursor as text and bind it as a bigint so rowids above
2^53 do not fail. Tests cover those rowids, WITHOUT ROWID tables, a column
named rowid, covering indexes that retain main's tie order, and trajectory
paging. Copy each usage message before decoding it so the row blob can
be freed.
Refs #13852
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent ed0f7b9 commit 39769cd
2 files changed
Lines changed: 474 additions & 17 deletions
0 commit comments