Public: anyone can read this; the crew can change it.

readKpis counts the day's landings without the correlated NOT EXISTS over every pull #7627

shipped production is serving it opened this has it
opened this

Part of #7494. The landings query in src/flow/kpis.ts has a per-row NOT EXISTS that scans pull joined to issue for each landing, to drop duplicate merged_oids. It is the likeliest cost of the 4.4 s.

Done when:

  • [ ] The landings are read in one pass. For example: take the pulls merged in the window, then keep the first per (repo, merged_oid) in TypeScript, or use GROUP BY with MIN(merged_at).
  • [ ] The counts match today's for the same data: the existing kpi tests pass unchanged.
  • [ ] A new test seeds 20,000 merged pulls and checks that readKpis answers in under 100 ms against the baselineMs floor.
  • [ ] No new migration. If an index is truly needed, the pull says why, and the pin and migration land together with the production-size home test green.

Files: src/flow/kpis.ts, one test. Risk: a duplicate merged oid counted twice; cover it in the test.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs