/** * IndexAdvisor (v3.1) * * Heuristic rules mapping a {@link NormalizedPlan} → a list of * {@link IndexAdvice}. Currently 4 rules: * * 1. seq_scan: any SQLite/MySQL/PG node whose op matches /(SCAN|Seq|FULL)/i * and reports rows > 1000 → suggest a single-column index on the * table's first referenced column. * 2. large_estimate: any node with rows >= 50000 → 'high' impact on * the most specific column we can infer. * 3. no_index_join: nested-loop join where inner side has no `index` * → recommend index on join column. * 4. sort_no_index: SORT step on a table that has no `index` → recommend * a covering index with ORDER BY columns. * * Output is conservative by design: missing obvious advice is acceptable, * but false positives are explicitly avoided (heuristic skips when uncertain). */ import type { NormalizedPlanNode } from './explain-parser.js'; export interface IndexAdvice { sql: string; table: string; columns: string[]; impact: 'low' | 'medium' | 'high'; reason: 'seq_scan' | 'large_estimate' | 'no_index_join' | 'sort_no_index'; evidence?: NormalizedPlanNode[]; } export declare class IndexAdvisor { /** Run all heuristics against the plan. Returns 0+ advice items. */ static analyze(plan: import('./explain-parser.js').NormalizedPlan): IndexAdvice[]; } //# sourceMappingURL=index-advisor.d.ts.map