Repository navigation
perf(sync): keep re-emitted synthesized rows on publish instead of rewriting the set - #577
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 40 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
7929861 to
31137ec
Compare
|
@coderabbitai review |
|
…writing the set A one-file sync deleted every synthesized edge and reinserted them all, and rewrote each recorded synth_skips row — ~800 identical edge rows (plus their index pages) and ~900 skip-table leaf pages churned on a 20k-file repo where upstream's input-scoped refresh writes ~70 pages. The refresh still recomputes over the whole graph — the precision guarantee stands — but publish now reconciles: re-emitted edges keep their rows, only stale ones are deleted, and drifted metadata updates in place. synth_skips skips the write when the merged row is identical. Failure paths keep the old drop-all semantics (missing edges, never wrong ones). Measured on discourse: filesystem outputs 35.8k -> 2.8k sectors on a one-file sync, below upstream's 4.6k; changed DB pages 1,386 -> 80 vs upstream's 71.
31137ec to
d8ab781
Compare
|
@coderabbitai review |
|
Summary
resynthesizecaptures the emitted edge set; stored synthesized edges a pass re-emitted keep their rows, only un-emitted ones are deleted, and drifted metadata updates in place (QueryBuilder.reconcileSynthesizedEdges).saveSynthSkipsno longer rewrites a row whose merged result is identical to what's stored.Why
idx_edges_*leaves (~800 identical edges deleted+recreated by the unscoped delete-all + full re-synthesis) plus ~900synth_skipsleaf pages (20k rows rewritten every refresh). Upstream's input-scoped refresh never fires onconfig/boot.rb; ours recomputed over the whole graph — the precision guarantee stays — but now publishes only the delta.Measured
Test plan
sync-rebuild-convergence(25),sync-resynthesis(13),synth-skips— 42/42 pass on this base