cmu-db / peloton

The Self-Driving Database Management System
http://pelotondb.io
Apache License 2.0
2.03k stars 623 forks source link

Support ability to Analyze all tables #1360

Open nappelson opened 6 years ago

nappelson commented 6 years ago

Right now, analyze_executor does not support analyzing all tables. If you run Analyze;, it returns as if it were successful but doesn't actually analyze the tables. I think we should first add logging to specify that we don't support Analyze; if we don't end up making it work soon.

Here is the snippet from src/executor/analyze_executor.cpp that indicates we don't support it


if (target_table != nullptr) {
    LOG_TRACE("Analyzing table %s", node.GetTableName().c_str());
    ResultType result = stats->AnalyzeStatsForTable(target_table, current_txn);
    current_txn->SetResult(result);
    if (result == peloton::ResultType::SUCCESS) {
      LOG_TRACE("Successfully analyzed table %s", node.GetTableName().c_str());
    } else {
      LOG_TRACE("Failed to analyze table %s", node.GetTableName().c_str());
    }
  } else {
    // other operations unsupported for now
    current_txn->SetResult(peloton::ResultType::SUCCESS);
  }