Repository navigation
perf(d1): avoid catalog scans for admissions - #624
Conversation
🤖 MERGED
GitHub merged this pull request. No material findings were recorded. e9fa0cbe-9538-4da6-a0e3-82ab8d16e934 |
|
Agent verification, using read-only queries against production D1: The previous loader and the rewrite returned identical rows, order, descriptions, stars, sibling counts, and totals. Comparisons covered pages 1, 2, and 999 on each board. Both paths used the same indexable Skill set.
After totals include both statements on populated pages. Empty pages use one statement and preserved their full totals. Every statement reported zero rows written. Each timing is one execution, not a latency percentile. Background jobs remained active. The first count-only rewrite still scanned about 21,400 Skill rows. Admission-first CROSS JOINs removed that scan. Live query plans showed an admission scan followed by existing Skill and Repository index lookups. Repository counts also use existing indexes. The comparison called the actual exported loaders through a read-only D1 adapter. Raw SQL, parameters, metadata, and results are retained in the session scratchpad. |
There was a problem hiding this comment.
Harlan Agent Kit posted this automated review. AI open source policy.
Automated Review: READY.
🔗 Linked issue
Follow-up to #620 and #622.
❓ Type of change
📚 Description
Admissions scanned the resolved Skill catalog and counted Repository siblings before filtering and pagination. The query now starts from admissions and counts each returned Repository once after selecting the page.
Live D1 comparisons returned identical rows, order, sibling counts, and totals across all three boards. Populated pages read 94–98% fewer rows, including both queries. No indexes or migrations change.