You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Named paths build path values that the query never reads #212
On the LDBC SF1 graph this finds 86,096 paths, and PathMatchExec emits about 100 MB of path values (node records, relationship records and their endpoints) only for count(*) to discard them. Both routes pay for it: the edge inventory takes the records from its prebuilt arrays, and the CSR walk from #211 reads each returned relationship's columns from its table.
This is the one shape #211 left slower than main. In lazy mode the CSR walk reads those relationships from Lance by row, while the inventory scans the 180K-edge knows table once (release builds, best of 5):
When the query never references the path variable (p, nodes(p), relationships(p), length(p) and so on), plan the named path without a path value, the way the planner already does for an unnamed, bounded undirected segment with several types. PathMatchExec then emits only the boundary columns, and neither route builds node or relationship records it doesn't return.
The planner side is in build_path_match (crates/lance-csr/src/datafusion_planner/builder/path_ops.rs), which sets PathSpec::variable. PathMatchNode::try_new adds the path column when that is set, and the operator then calls paths_array and, on the CSR route, builds relationship records.
How to check
The count query above, and queries such as RETURN b.ID over a named path that never read p, no longer build path values on either route. EXPLAIN ANALYZE's output_bytes for PathMatchExec should drop from about 100 MB.
Queries that do read p or its functions return the same results as before.
Time the count query on SF1 in both memory and lazy modes, and run both benchmark suites as CONTRIBUTING.md describes.
Activity