docs(RETURN): document pattern expressions in projections#364
Open
gregfelice wants to merge 1 commit into
Open
docs(RETURN): document pattern expressions in projections#364gregfelice wants to merge 1 commit into
gregfelice wants to merge 1 commit into
Conversation
Pattern expressions (path patterns such as (a)-[:KNOWS]->(:Person)) can be used directly in a RETURN/WITH projection, not only as WHERE predicates. Adds a worked example to the RETURN reference with verified output, plus a performance note: a pattern expression is evaluated as an EXISTS subquery once per result row, so its cost scales with the number of rows projected. Documents the projection capability added in apache/age#2360.
14 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What — Documents that pattern expressions (path patterns such as
(a)-[:KNOWS]->(:Person)) can be returned directly from aRETURN/WITHprojection, not only used asWHEREpredicates. Adds a worked example to the RETURN reference with verified output, plus a performance note.Why — Follow-up to the review of apache/age#2360. The reviewer asked that the per-row
EXISTS-subquery cost of pattern expressions in projection contexts be discoverable from the Cypher reference, not just the PR history.Performance note — A pattern expression is evaluated as an
EXISTSsubquery, once per result row in a projection, so cost scales with rows projected. The note makes only this mechanically-grounded claim.Depends on apache/age#2360 (the projection capability); should not merge before it.
Verification — Example output generated against a PG18 build of the #2360 branch using the canonical doc graph (
intro/aggregation.md).