Skip to content

docs(RETURN): document pattern expressions in projections#364

Merged
jrgemignani merged 1 commit into
apache:masterfrom
gregfelice:docs_pattern_expr_projection
Jun 11, 2026
Merged

docs(RETURN): document pattern expressions in projections#364
jrgemignani merged 1 commit into
apache:masterfrom
gregfelice:docs_pattern_expr_projection

Conversation

@gregfelice

Copy link
Copy Markdown
Contributor

What — Documents that pattern expressions (path patterns such as (a)-[:KNOWS]->(:Person)) can be returned directly from a RETURN/WITH projection, not only used as WHERE predicates. 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 EXISTS subquery, 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).

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.
@jrgemignani jrgemignani merged commit 2c202b7 into apache:master Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants