Overview
Query Tuning Playbook
A repeatable performance method using PROFILE, schema assertions, and controlled rewrites.
Why it matters
Most teams tune Cypher by folklore. A disciplined playbook turns query tuning into measurable engineering work.
Going deeper
A disciplined loop turns tuning into measurable engineering:
- Baseline —
PROFILEthe query, record db hits per operator. - One change — add an index, constrain a relationship type/direction, or tighten a pattern. Never two at once.
- Re-profile — compare db hits, not wall-clock (which is polluted by cache state and network).
- Keep or revert — keep only changes that cut db hits and keep the query readable.
The highest-yield findings are almost always: a NodeByLabelScan that should be a NodeIndexSeek (missing index), an unbounded/untyped Expand(All), or an Eager operator forcing the whole result to materialize. If db hits don't move, you changed syntax, not the plan.