mirror of
https://github.com/block/buzz.git
synced 2026-11-24 18:21:59 +00:00
Reverts #9591 (`perf(db): stop per-id planning of wide #e reads`). Hiding the `#e` id arrays from the planner made reads in large communities much slower in prod. This is a straight revert. ## Evidence - **8 → 9 row cliff on the channel head read with `include_aux`:** 125ms at 8 rows, 1.4s at 9 rows, about 2.3s at 20 rows. - **Replica `EXPLAIN ANALYZE`, 20-id aux query:** 130ms with the ids visible to the planner, 2240ms with them hidden. The hidden plan reads and discards about 625k rows in `events_p2026_07_08_legacy`. - **200-id thread page (1,593-reply thread):** | ids | plan | exec | |---|---|---| | visible (this PR) | 78ms | 1,387ms | | hidden (#9591) | 10ms | 18,146ms | #9591 saves planning time but makes execution about 13x slower. - **Prod:** #9591 reached bb-block prod with `main-20261120032502-8d4b301` (2026-11-20 14:48Z). ## Notes - #9674 used the same trick for thread-window aux reads and had the same risk. It's now closed. - Any future change like this should be checked with `EXPLAIN ANALYZE` on the replica first. A test that runs EXPLAIN against a large community is a follow-up, not part of this PR. ## Testing - `cargo test -p buzz-db --lib e_tag` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Bradley Axen <baxen@squareup.com> Co-authored-by: mbot <3754f8729004d95654c46dbab3129e4ab9ef05cc2534e2a3fbfc155983bd637b@buzz.block.builderlab.xyz> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>