4882c1c9cf382b3ebdf2c0f7a86a296d390beb22
dirty-sales-summaries index-pulled from [client-id true] and then filtered by client. index-pull returns a lazy seq running to the END of the index, and a lazy filter does not stop it, so for every client the job walked every summary belonging to every client sorting after it — pulling their items along the way. Quadratic in the number of summaries. take-while stops at the client boundary instead, which is safe because :sales-summary/client+dirty sorts by client first, so a client's dirty summaries are contiguous from that start point. Measured on a 14,458-summary database: 1,321ms -> 5.6ms per client, a 237x improvement, with identical results. A full refresh had been degrading from ~180 client-days a minute to ~3 as summaries accumulated. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Description
No description provided
Languages
Clojure
91%
CSS
4.2%
Sass
2.3%
HTML
1.2%
HCL
0.4%
Other
0.7%