helix-query-optimize
Installation
SKILL.md
Helix Query Optimization
Optimize Helix queries by aligning their shape with what the Helix interpreter actually does at each step. Every rule in this skill is grounded in the source — see REFERENCE.md for the mechanism and the file:line cite, and EXAMPLES.md for paired Rust DSL + JSON forms.
When To Use
Use this skill when the task is to:
- understand why a Helix query is slow
- review a query for missed index push-down or accidental full scans
- decide if a
where_(...)orhas(...)is filtering at the index or in memory - tighten BM25 or vector search routes (tenant scope, distance lifecycle, projection)
- bound
Repeattraversals or orderCoalescebranches by cost - audit write-path safety (
drop_edgevsdrop_edge_by_id,add_ndupes,for_each_paramcost)
Reference Files
REFERENCE.md— full optimizer mental model: index types, source dispatch table, predicate-index resolution catalog,RuntimeStatetransitions, limit/dedup pushdown, OrderBy paths, projection rules, repeat/branching cost, batch semantics, write-path mechanics, dynamic query cost. Every claim citesenterprise/helix/src/traversal/interpreter.rs(helix-hyperscale) orsdks/rust/src/dsl.rs(thehelix-dbDSL crate).EXAMPLES.md— paired Rust DSL + JSON dynamic patterns for every optimization rule below: weaker form, stronger form, what changed and why.