pub struct MatchClause {
pub optional: bool,
pub match_mode: MatchMode,
pub pattern: Vec<PatternPath>,
pub using_scan: Vec<ScanHint>,
pub using_index: Vec<IndexHint>,
pub using_join: Vec<JoinHint>,
pub where_expr: Option<Expr>,
pub search: Option<SearchClause>,
}Expand description
MATCH clause.
Fields§
§optional: bool§match_mode: MatchModeCIP-51/CIP-60 match mode: whether relationship uniqueness (the
default DIFFERENT RELATIONSHIPS) is enforced across the whole
comma-separated graph pattern, or relaxed (REPEATABLE ELEMENTS).
pattern: Vec<PatternPath>§using_scan: Vec<ScanHint>CIP-79 variables named by a USING SCAN <var>:<Label> hint.
Relate’s planner is not cost-based, but a scan hint is not a
mere plan preference here: an indexed equality seek and a label
scan genuinely answer differently for a zoned-datetime DST overlap
(the index keys on instant plus zone, = on the wall clock), so
the hint must reach the executor — the one hint family that does;
USING INDEX stops at the front-end fulfillability check and
USING JOIN ON at the plan-time notification, per the two
fields below.
using_index: Vec<IndexHint>CIP-79 USING INDEX [SEEK] <var>:<Label>(<prop>[, …]) hints. The
planner is not cost-based so they steer nothing, but the front end
still validates that each hint is fulfillable — Neo4j rejects an
undefined hint variable and an unfulfillable hint at compile time
(SemanticErrorPart2 “An index hint … is rejected”), which needs the
hint preserved here.
using_join: Vec<JoinHint>CIP-79 USING JOIN ON <var>[, <var>…] hints. The planner is not
cost-based so a join hint steers nothing — every one is
unfulfillable, which the 01N30 plan-time notification reports
(ADR-0363); retaining the hint here is what lets the IR carry it
to that detector.
where_expr: Option<Expr>§search: Option<SearchClause><search clause>: SEARCH <binding var ref> IN (VECTOR INDEX <index name> FOR <expr> LIMIT <expr>) [SCORE AS <var>], a
subclause of <match statement>. The grammar allows the <graph pattern where clause> to appear either before or after the search
clause with no semantic difference (CIP-224 “Canonical syntax”), so
the parser folds both orderings into this same where_expr field –
the source order isn’t tracked in the AST.