Skip to content

Commit 75a6cda

Browse files
clarify cardinality nuance
1 parent a59f431 commit 75a6cda

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/ROOT/pages/patterns/shortest-paths.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ ready to start consuming query after 40 ms, results consumed after another 331 m
779779
780780
If the query is rewritten with a `CALL` subquery the planner will use `StatefulShortestPath(Into)` which performs separate traversals for each individual source-target node pairs.
781781
782-
.Multi-target shortest path query rewritten with a CALL subquery
782+
.Multi-target shortest path query rewritten with a `CALL` subquery
783783
[source, cypher]
784784
----
785785
PROFILE
@@ -840,8 +840,8 @@ a| Used when:
840840

841841
* The xref:patterns/reference.adoc#shortest-functions[`shortestPath()` or `allShortestPaths()`] functions are used.
842842

843-
Or, if the planner estimates a single source-target node pair and the following are all true:
844-
843+
Or, when the estimated cardinality of the source and target nodes in a shortest path are 1 or less and the following are all true:
844+
845845
* Selector is one of: `SHORTEST 1`, `ANY`, `ANY SHORTEST`, `ALL SHORTEST`, `SHORTEST GROUP`, or `SHORTEST 1 GROUP`.
846846
* There is only one relationship pattern.
847847
* If the pattern is a xref:patterns/variable-length-patterns.adoc#quantified-path-patterns[quantified path pattern] in the form of `\(()-[]-())`, or is a xref:patterns/variable-length-patterns.adoc#quantified-relationship[quantified-relationship], and it uses a filter that can be applied directly to the relationship.
@@ -850,7 +850,7 @@ Or, if the planner estimates a single source-target node pair and the following
850850
| `StatefulShortestPath(Into)`
851851
| Performs bidirectional BFS from target and source node.
852852
Terminates when a shortest path is found between them.
853-
a| Used when the planner estimates a single source-target node pair in a shortest path and either of the following are true:
853+
a| Used when the estimated cardinality of the source and target nodes in a shortest path are 1 or less and either of the following are true:
854854

855855
* Selector is one of: `ANY/SHORTEST k` or `SHORTEST k GROUPS` and `k` is larger than `1`.
856856
* There is more than one relationship pattern.

0 commit comments

Comments
 (0)