export function explainQueries(counts, db) {
    const plans = {};
    for (const querySet of Object.values(counts)) {
        const queries = Object.keys(querySet);
        for (const query of queries) {
            const plan = db
                // we should be more intelligent about value replacement.
                // Different values result in different plans. E.g., picking a value at the start
                // of an index will result in `scan` vs `search`. The scan is fine in that case.
                .prepare(`EXPLAIN QUERY PLAN ${query.replaceAll('?', "'sdfse'")}`)
                .all()
                .map(r => r.detail);
            plans[query] = plan;
        }
    }
    return plans;
}
//# sourceMappingURL=explain-queries.js.map