explainQuery method

String explainQuery(
  1. String table,
  2. QuerySpec spec
)

The EXPLAIN QUERY PLAN output for the SQL that queryDocIds would run for spec — one plan line per row. A diagnostic: use it to confirm a predicate on an indexed path searches its index instead of scanning.

Implementation

String explainQuery(String table, QuerySpec spec) {
  final (sql, params) = _compileQuery(table, spec);
  final rows = _open.select('EXPLAIN QUERY PLAN $sql', params);
  return rows.map((r) => r['detail']).join('\n');
}