Docs: clarify VLE semantics and cost model (#2349)#2413
Merged
jrgemignani merged 1 commit intoapache:masterfrom Apr 25, 2026
Merged
Docs: clarify VLE semantics and cost model (#2349)#2413jrgemignani merged 1 commit intoapache:masterfrom
jrgemignani merged 1 commit intoapache:masterfrom
Conversation
Adds a block comment at the top of age_vle.c documenting (a) the edge-isomorphism semantics that openCypher mandates for variable-length relationship matching, (b) the cost model distinction between bounded and unbounded patterns, and (c) a pointer to the enforcement site (edge_state_entry.used_in_path, dfs_find_a_path_*, is_edge_in_path). Motivation: issue apache#2349 misdiagnosed the VLE as lacking cycle detection and proposed a visited-node filter as a fix. Cycle prevention already exists via edge-uniqueness, and swapping to vertex-isomorphism would silently drop spec-valid paths (e.g. triangle traversals where the endpoint coincides with the start vertex). Capturing the semantics and cost model in-source prevents future readers from repeating the same misanalysis. No behavior change. Cassert installcheck: 33/33.
jrgemignani
approved these changes
Apr 25, 2026
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.
Summary
Adds an in-source design-note comment block at the top of
src/backend/utils/adt/age_vle.cdocumenting:[*min..max]is polynomial in edge count for fixedmax; unbounded[*]/[*1..]is factorial worst-case on cycle-rich graphs. This is inherent to edge-isomorphic enumeration and cannot be reduced without changing semantics.edge_state_entry.used_in_path,dfs_find_a_path_between/dfs_find_a_path_from, andis_edge_in_path()as the cycle-prevention enforcement sites.Motivation
Issue #2349 misdiagnosed the VLE as lacking cycle detection and proposed a visited-node filter as a fix. Cycle prevention already exists via edge-uniqueness, and the proposed change would violate the openCypher specification. The current source has no overview comment explaining these semantics, so a future reader would have to reconstruct them from the DFS code and the spec. This comment block captures the semantics and cost model at a point the reader is guaranteed to pass through, preventing repeat misanalysis.
Per @jrgemignani's guidance on #2349, no GUC, no code change — just documentation.
Scope
src/backend/utils/adt/age_vle.c— 44-line comment block inserted between the license header and the first#include).Test plan
--enable-cassertPG18) clean, no new warningsinstallcheckgreen — 33/33 AGE tests pass, includingcypher_vle