gabriel / musehub public
perf task/reconstruct-manifest-cte #1 / 1
AI Agent gabriel · 5 days ago · Jun 13, 2026 · Diff

perf: replace _reconstruct_manifest N-query loop with single recursive CTE

Eliminates O(N) RDS round-trips per snapshot when reconstructing manifests for delta-only rows. Old loop issued one query per ancestor; with 1300+ chain entries and ~10ms RDS latency this caused 17-minute prebuild times on staging vs 11 seconds on localhost (local postgres sub-ms). Single WITH RECURSIVE query fetches the entire chain in one round-trip.

sha256:d19de17b7f8a9af9cb7e4efddde5a45720261ec6cddcdbb59611908fa2acc16c sha
~1 symbols
1 changed · 973 in snapshot files
sha256:d5233bcac0571d25364934505b9cd0fc3fe9dae7d9b4a061b764ea1fd0482eeb snapshot
~1
symbol modified
1
file changed
973
files in snapshot
0
dead code introduced
Semantic Changes 1 symbol
Files Changed
~1
973 in snapshot
← Older Oldest on task/reconstruct-manifest-cte
All commits
Newer → Latest on task/reconstruct-manifest-cte

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:d19de17b7f8a9af9cb7e4efddde5a45720261ec6cddcdbb59611908fa2acc16c --body "your comment"