server-query-optimizer
Installation
SKILL.md
Couchbase SQL++ Query Optimizer
Diagnose slow SQL++ queries and recommend GSI indexes.
Workflow
1. Run EXPLAIN
EXPLAIN SELECT name, iata FROM `travel-sample`.inventory.airline WHERE country = "United States";
| Operator | Meaning | Action |
|---|---|---|
IndexScan3 |
Using a GSI ✅ | Check if covering |
PrimaryScan3 |
Full collection scan ❌ | Add a GSI on filter fields |
Fetch |
KV fetch after index scan | Consider a covering index |
IntersectScan |
Multiple indexes merged | May need a composite index |
HashJoin / NLJoin |
Join method | Check join key indexes |