Repository navigation
fix: Cypher OR index seeks, index order for more ORDER BY shapes, parallel filtered scan (#8723 #8724 #8725) - #8771
Conversation
…r in more cases, parallel filtered label scan - #8723: an OR of equalities/IN on indexed properties is an IN-list seek (one property) or a de-duplicated union of seeks (several); EXPLAIN prints IN values - #8724: ORDER BY ... LIMIT reads the index in both directions for MANDATORY+NOTNULL, WHERE x IS NOT NULL, and NULL_STRATEGY INDEX - #8725: NodeByLabelScan evaluates a parallel-safe filter in the workers of the shared parallel type scan
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (18)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 178 |
🟢 Coverage 91.89% diff coverage · -5.96% coverage variation
Metric Results Coverage variation ✅ -5.96% coverage variation Diff coverage ✅ 91.89% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (cb43e1e) 201419 169885 84.34% Head commit (015fce6) 234324 (+32905) 183663 (+13778) 78.38% (-5.96%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#8771) 370 340 91.89% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Review of #8771 (Cypher OR index seeks, index order for more ORDER BY shapes, parallel filtered scan) Overall this is a well-scoped change. The safety model is sound: seeks only need to return a superset because the WHERE is still evaluated above the anchor, the parallel predicate is whitelist-based and falls back on any unknown node, and the tests cross-check parallel against sequential runs. Nothing here blocks the merge, but the points below are worth addressing. Potential bugs / correctness
Design / performance
Style / CLAUDE.md conformance
Tests Coverage is good: OR on one property, parameters, two properties, both-disjunct dedup, IN plus AND disjunct, non-indexed disjunct keeping the scan,
Once points 1 and 2 are addressed I would be comfortable merging. |
…nion seek, thread-safety note and test, import order
|
Review Solid, well-scoped change. Reusing Correctness / risk
Code quality / style
Performance
Tests Good coverage of the main shapes (same property, two properties, dedup when both disjuncts match, AND inside OR, non-indexed disjunct, null param, other variable, EXPLAIN text, the NullKeys modes, transaction fallback). Suggested additions: items 3, 4 and 5 above, plus a descending No security concerns: no new dependencies and no new parameter handling beyond the existing IN-seek. 🤖 Generated with Claude Code |
… tests (numeric param types, second MATCH, null-key batches, string predicates, worker failure)
Review of #8771 (Cypher OR index seeks, ORDER BY index order, parallel filtered scan)Overall this is a well-structured change. The WHERE is still evaluated above the new seeks, so the union is always a superset and correctness does not depend on the seek being exact. I found no blocking issues. Tests are thorough: each parallel answer is compared against the sequential run (rows and order), and the OR cases cover de-duplication, AND disjuncts, non-indexed disjuncts falling back to a scan, null disjuncts and other-variable ORs. I did not run the suite myself; this is from reading the diff. Things worth a second look
Minor / style
Performance / securityNo security concerns: no new inputs are parsed, and the seek values are the same literal/parameter expressions the IN path already resolves. Performance looks positive overall (index seeks instead of scans, filter evaluated in workers, only survivors reach the consumer). The one regression risk is item 1. Nice work, especially on keeping the WHERE above the anchor and on the sequential-equivalence tests. |
…, state-safety test for parallel-safe expressions, more tests, cleanups
|
Review of #8771 (Cypher OR index seeks, index order for more ORDER BY shapes, parallel filtered scan) Overall this is a well-structured change. Reuse is good ( Potential issues
Minor / style
Security / performance No security concerns: no new external input handling, parameters are only used as seek keys. Performance looks positive overall: the OR seek replaces full scans, dedupe is a RID set bounded by the cost check against scan cost, and the parallel scan is gated by the same rules as the SQL one. Nothing here is clearly blocking; items 1 and 3 are the ones I would like confirmed before merge. |
…e deadline check, remove unused overload, subtype test, document constraint trust
|
Review of #8771 (Cypher OR index seeks, ORDER BY index order, parallel filtered scan) I read the diff and did not run the suite. Several earlier review comments exist on this PR, so I list only what is new. The design is sound:
New observations
Style (CLAUDE.md)
Test gaps
No security concerns. Performance is positive overall. Nothing here blocks the merge, and item 1 is the one I would fix before merging. 🤖 Generated with Claude Code |
Review of #8771 (Cypher OR index seeks, index order for ORDER BY LIMIT, parallel filtered label scan)I read the full diff and traced the riskier paths. I did not build the branch or run the tests. Overall this is solid work: the correctness strategy is sound (seeks only produce a superset and the WHERE is still evaluated above the anchor), the parallel whitelist is conservative (an unknown node keeps the scan sequential), and the tests cover the tricky edges. Nothing here looks like a blocker. Notes below, roughly by importance. Correctness and risk
Parallel scan (#8725)
Style and conventions (CLAUDE.md)
TestsGood breadth: dedupe when both disjuncts match, null disjunct, numeric type mismatch, OR on another variable, nullable descending fallback, null keys spanning several fetch batches, worker failure leaving the DB usable, function predicate staying sequential. Gaps I would add:
Nice work; the items above are mostly hardening and extra tests. |
…, not the list; more tests (null keys vs zero/negative values, list+scalar parameters)
|
Review of #8771 (Cypher OR index seeks, ORDER BY index order for whole-label scans, parallel filtered label scan) I read the diff and the surrounding code and did not build or run the tests. Seven earlier review comments exist on this PR, so this one only covers what they did not, or where I can add information. I found no blocker. The core strategy holds: the WHERE stays above the anchor, so a seek only has to return a superset. New findings
Minor
Verdict Sound design and good coverage of the main shapes. I would address items 1 (possible wrong result) and 2 before merging; the rest is hardening. 🤖 Generated with Claude Code |
… not split into keys; scan cannot restart after close; union tests for composite and sub types
|
Review of PR 8771 (Cypher OR index seeks, index order for more ORDER BY shapes, parallel filtered scan) I read the main-source diff and the test names. I did not run the tests here. Overall this is a well-reasoned change. The safety argument (the seek yields a superset, the full WHERE is re-evaluated above the anchor) is sound, and the test coverage is broad. Nothing below blocks the merge. These are notes and questions. What looks good
Points worth a look
Tests and conventions
Nothing here looks like a correctness bug to me. Point 1 is the one I would want a conscious decision on before merge. 🤖 Generated with Claude Code |
…1; analytical reads outside a transaction (#32) (#33) ArcadeData#8771 fixed ArcadeData#8723, ArcadeData#8724, and ArcadeData#8725. The ordered-reads paragraph now says openCypher reads the index in order in both directions for a MANDATORY + NOTNULL property, under IS NOT NULL, and for a NULL_STRATEGY INDEX index (declare the constraints before loading); a Disjunctions paragraph covers OR over indexed properties; and a paragraph says filtered scans run in parallel only outside a transaction (43-57 ms against 255-291 ms inside one, both languages, 1M records). Claude-Session: https://claude.ai/code/session_01WWcDr7TwvcfMsQkeYQVHZr Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8771 +/- ##
============================================
+ Coverage 76.06% 76.09% +0.02%
- Complexity 3701 3702 +1
============================================
Files 2075 2079 +4
Lines 201314 201747 +433
Branches 42410 42542 +132
============================================
+ Hits 153131 153514 +383
- Misses 31573 31589 +16
- Partials 16610 16644 +34 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes #8723, #8724, #8725.
Tests: Issue8723/8724/8725 tests added; Issue5362 test updated (OR is now a seek). Ran 6098 opencypher + parallel scan tests, green.
Summary by CodeRabbit
New Features
ORconditions can use index seeks, including conditions across multiple properties, while avoiding duplicate results.ORDER BYrequests, including supported null-handling cases.Bug Fixes
INvalues and index-seek details.Behavior note (#8724): for a property declared MANDATORY and NOTNULL, ORDER BY ... LIMIT over the whole label now trusts the constraint and reads the index without the null-key fallback scan, as SQL already does (#8701). ALTER PROPERTY does not validate vertices written before the constraint, so a type that gained it over existing data must be repaired first.