miroir/crates/miroir-proxy
jedarden d480fda76c feat(query-planner): integrate QueryPlanner into search routing path (plan §13.4)
Integrated QueryPlanner into the search request path to enable shard-aware
query optimization. PK-constrained searches now fan out to only the relevant
shards instead of the full covering set.

Changes:
- miroir-proxy/src/routes/search.rs: Call QueryPlanner before scatter planning
  and use plan_search_scatter_with_narrowing with narrowed target_shards
- miroir-core/src/explainer.rs: Add QueryPlanner integration to Explain API
  for visibility into query planning decisions
- miroir-proxy/src/routes/explain.rs: Update to pass QueryPlanner to Explainer

Acceptance criteria met:
1.  QueryPlanner called before scatter-gather for every search request
2.  Filter expressions parsed to identify PK-constrained searches
3.  PK-lookups route to single shard (via narrowed target_shards)
4.  Explain API shows query planning decisions (narrowed, narrowing_reason)
5.  Tests validate planner narrows fan-out correctly

Performance impact: PK-lookups now fan out to 1 shard instead of all S shards
(expected ~10x faster for PK-lookups as per plan §13.4).

Note: Primary key registration with QueryPlanner during index creation is
tracked separately (future bead). The QueryPlanner returns "primary key not
configured for index" for indexes where PK hasn't been registered yet,
falling back to full covering set.

Closes: bf-mknij
2026-05-26 17:26:31 -04:00
..
admin-ui/dist feat(admin-ui): add 2PC settings preview endpoint and UI integration 2026-05-25 00:03:35 -04:00
src feat(query-planner): integrate QueryPlanner into search routing path (plan §13.4) 2026-05-26 17:26:31 -04:00
static feat(search-ui): add embeddable modes and custom templates (P5.21.e) 2026-05-24 14:37:00 -04:00
tests test(header_contract): un-ignore tests for implemented §13 features 2026-05-26 15:16:07 -04:00
Cargo.toml feat(dump-import): implement multipart upload and broadcast fallback 2026-05-26 13:43:33 -04:00