planSelect method

Plan planSelect(
  1. SelectStmt stmt
)

Implementation

Plan planSelect(SelectStmt stmt) {
  if (stmt.join != null) {
    return _planJoin(stmt);
  }

  final meta = catalog[stmt.table];
  if (meta == null) throw Exception('Table "${stmt.table}" not found');

  // If we have no stats, fall back to the rule-based planner.
  if (!stats.has(stmt.table)) {
    return Planner(catalog).planSelect(stmt);
  }

  return _planSingleTable(stmt.table, meta, stmt.where);
}