=== Applying patches on top of PostgreSQL commit ID 35d3f2069a3c842665bbc020295fb165dcb2b6ec === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Tue Sep 8 03:05:28 UTC 2026 On branch cf/7034 nothing to commit, working tree clean === using 'git am' to apply patch ./v2-0001-Rewrite-undirected-edge-patterns-in-GRAPH_TABLE-using-UNION-ALL.patch === Applying: Rewrite undirected edge patterns in GRAPH_TABLE using UNION ALL Using index info to reconstruct a base tree... A src/backend/rewrite/rewriteGraphTable.c Falling back to patching base and 3-way merge... CONFLICT (modify/delete): src/backend/rewrite/rewriteGraphTable.c deleted in HEAD and modified in Rewrite undirected edge patterns in GRAPH_TABLE using UNION ALL. Version Rewrite undirected edge patterns in GRAPH_TABLE using UNION ALL of src/backend/rewrite/rewriteGraphTable.c left in tree. error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Rewrite undirected edge patterns in GRAPH_TABLE using UNION ALL When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". === using patch(1) to apply patch ./v2-0001-Rewrite-undirected-edge-patterns-in-GRAPH_TABLE-using-UNION-ALL.patch === can't find file to patch at input line 36 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |From 8d9ade2cc6a8cb15d26832f609960f4d486c660c Mon Sep 17 00:00:00 2001 |From: AyoubKAZ |Date: Wed, 15 Jul 2026 02:22:56 +0200 |Subject: [PATCH] Rewrite undirected edge patterns in GRAPH_TABLE using UNION | ALL | |Previously, undirected edge patterns (-[e]-) were rewritten by combining |the join conditions for both traversal directions into a single OR qual |(src=v1 AND dst=v2 OR src=v2 AND dst=v1). This usually implied using an unefficient BitmapOR scan or the full evaluation of the disjunction, which |becomes particularly costly when intermediate result sets are large, as is |typical in graph queries with undirected edges. | |Instead, replace the edge relation with a UNION ALL subquery consisting of |two scans of the edge table: a forward scan that projects columns as-is, |and a backward scan that swaps the source and destination key columns. |This allows the outer query to use a single equi-join to match edges |traversed in either direction. | |When the source and destination vertex patterns share the same path factor |(e.g., (p)-[k]-(p)), the forward orientation already satisfies both |directions through a single equi-join, so the UNION ALL is skipped |entirely. | |When the UNION ALL is used, a self-loop edge (srckey = destkey) would |appear in both branches and be returned twice, violating the SQL/PGQ |standard. A NOT(srckey = destkey) filter applied to the backward branch, |built by build_edge_self_loop_filter(), prevents this duplication. |--- | src/backend/rewrite/rewriteGraphTable.c | 333 ++++++++++++++++++++++-- | 1 file changed, 307 insertions(+), 26 deletions(-) | |diff --git a/src/backend/rewrite/rewriteGraphTable.c b/src/backend/rewrite/rewriteGraphTable.c |index cdb1f4c0dca..138d8d8a14d 100644 |--- a/src/backend/rewrite/rewriteGraphTable.c |+++ b/src/backend/rewrite/rewriteGraphTable.c -------------------------- No file to patch. Skipping patch. 10 out of 10 hunks ignored === using 'git apply' to apply patch ./v2-0001-Rewrite-undirected-edge-patterns-in-GRAPH_TABLE-using-UNION-ALL.patch === error: src/backend/rewrite/rewriteGraphTable.c: does not exist in index