'use client'; import { IndexRecommendation } from "../query.cjs"; //#region src/action-plan/index-coverage.d.ts /** A unique index recommendation plus how it scored across the queries it helps. */ interface AggregatedIndexRecommendation { index: IndexRecommendation; affectedQueryCount: number; averageCostReduction: number; bestCostReduction: number; affectedQueryHashes: string[]; } /** * Check if indexA covers indexB (A is a superset that includes B as a prefix). * * Rules: * - Same schema and table * - A's columns start with B's columns (B is a prefix of A) * - Sort directions must match for prefix columns * - WHERE clauses must be compatible * * Examples: * - (a, b, c) covers (a, b) and (a) * - (a DESC, b) covers (a DESC) but NOT (a ASC) */ declare function indexCovers(a: IndexRecommendation, b: IndexRecommendation): boolean; interface IndexGroup { /** The covering index (largest/most comprehensive) */ primary: AggregatedIndexRecommendation; /** Indexes that are covered by the primary (prefixes of primary) */ covered: AggregatedIndexRecommendation[]; } /** * Group indexes by coverage relationships. * * Returns groups where each group has a "primary" index that covers * zero or more "covered" indexes. Indexes that don't cover or aren't * covered by any other index become their own single-item group. */ declare function groupIndexesByCoverage(indexes: AggregatedIndexRecommendation[]): IndexGroup[]; //#endregion export { AggregatedIndexRecommendation, IndexGroup, groupIndexesByCoverage, indexCovers }; //# sourceMappingURL=index-coverage.d.cts.map