perf(db): batch graph, text, and vector deletions - #976
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
36a3491 to
ebc57b3
Compare
matthewsanetra
left a comment
There was a problem hiding this comment.
I found three issues in the new deletion benchmark tooling that should be addressed before merging:
-
Legacy graph benchmark records are silently discarded.
load_groupignores every JSONL line that failsSampleRecorddeserialization (crates/db/examples/deletion_benchmark_compare.rs:74). The graph fixtures included in this PR use the older case schema and omit fields now required byDeletionBenchmarkCase, so the documented graph comparison exits successfully without producing any result. Please either support the legacy schema or return an error for malformed samples, and reject empty comparison groups. -
Indexed deletion benchmarks verify only graph counts.
verify_and_closechecks node and edge counts, but never verifies that secondary, text, or vector index entries were removed (crates/db/tests/production_support/deletion_batch.rs:490). A regression that skips index deletion could therefore pass the benchmark and appear faster. Please add family-specific post-delete verification, including after reopen, for the selected index families. -
Multiple benchmark files conflate independent runs.
load_groupgroups samples only byrecord.run_id(crates/db/examples/deletion_benchmark_compare.rs:80). Because each benchmark invocation restarts run IDs at zero, comma-separated files merge unrelated runs. Passing two five-run files reports five runs with fifty samples each instead of ten runs with twenty-five samples each, which changes the hierarchical bootstrap population. Please key runs by both file identity and run ID.
Summary
Ports and combines the open Helix Proper drop-improvement work from HelixDB/helix-proper#64, #69, #70, #71, and #72.
NWhere -> Limit -> Dropregression coverageWhy
Large drop requests performed substantial graph and index deletion work one entity at a time. That repeated storage reads, topology updates, and search-index maintenance inside one write transaction. The new paths compute exact cohorts, coalesce repeated work, and apply bounded batches while retaining atomicity and fail-closed validation.
Impact
Large node-drop workloads should perform fewer storage round trips and repeated index mutations. Text and vector deletion work remains bounded, restart-safe, and immediately hidden from search. Explicit-ID retry semantics and direct
NWhere -> Limit -> Dropbehavior remain covered.Validation
cargo test --workspacecargo clippy --workspace -- -D warningscargo fmt --all -- --checkrustfmt --edition 2024 --checkon changed Rust files