This repository was archived by the owner on Nov 21, 2026. It is now read-only.
Repository navigation
bindings docs: ordered reads, project the sort property under its own name, and take the first value past a bound with ORDER BY ... LIMIT 1 (26.10.1, upstream #8811, #8812) - #43
Merged
Conversation
…y is projected under its own name (26.10.1, upstream ArcadeData#8811) (#42) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWcDr7TwvcfMsQkeYQVHZr
…T 1, not a ranged min()/max() (26.10.1, upstream ArcadeData#8812) (#42) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WWcDr7TwvcfMsQkeYQVHZr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #42.
The queries guide's 'Ordered reads over an optional property' paragraph gains two conditions, both measured on upstream main 3d5e1a5, 1,000,000 records, Temurin 25 and 21, every answer checked against a query no index serves:
ORDER BY p LIMIT kfrom an index onponly when the query projectspunder its own name, or the whole record.SELECT title ... ORDER BY createdAtandSELECT createdAt AS t ... ORDER BY tscan and sort: 642-806 ms against 0.4-0.9 ms; openCypher reads the index in every spelling. Upstream: SQL ORDER BY ... LIMIT stops reading the index in order when the sort property is aliased or not projected: SELECT b FROM V ORDER BY a LIMIT 5 scans 1M records (758 ms) where SELECT a ... takes 0.9 ms ArcadeData/arcadedb#8811.ORDER BY ts LIMIT 1reads one index entry (0.2-0.5 ms), whilemin(ts) ... WHERE ts > ?reads the whole range (136-145 ms in SQL, about 800 ms in openCypher). Upstream: min()/max() of an indexed property under a range on it read the whole range: SELECT min(a) FROM V WHERE a > ? takes 145 ms (openCypher 795 ms) where ORDER BY a LIMIT 1 takes 0.2-0.5 ms ArcadeData/arcadedb#8812.No example or harness query uses either slow spelling (checked by a scan of every SQL ORDER BY in bindings/python and benchmarks/experiments, and a grep for ranged min/max).
🤖 Generated with Claude Code
https://claude.ai/code/session_01WWcDr7TwvcfMsQkeYQVHZr