tp: Cleanup table related naming

New naming introduces clear division between two axes: execution time (once or everytime) and schema definition (compile or runtime). The same division will be added to functions.

Change-Id: I6b4045d32424c964b02d8352610b7ba626ef827a
diff --git a/Android.bp b/Android.bp
index b40e467..d894544 100644
--- a/Android.bp
+++ b/Android.bp
@@ -10350,10 +10350,10 @@
     name: "perfetto_src_trace_processor_perfetto_sql_engine_engine",
     srcs: [
         "src/trace_processor/perfetto_sql/engine/created_function.cc",
-        "src/trace_processor/perfetto_sql/engine/created_table_function.cc",
         "src/trace_processor/perfetto_sql/engine/function_util.cc",
         "src/trace_processor/perfetto_sql/engine/perfetto_sql_engine.cc",
         "src/trace_processor/perfetto_sql/engine/perfetto_sql_parser.cc",
+        "src/trace_processor/perfetto_sql/engine/runtime_table_function.cc",
     ],
 }
 
@@ -10419,7 +10419,7 @@
 filegroup {
     name: "perfetto_src_trace_processor_perfetto_sql_intrinsics_table_functions_interface",
     srcs: [
-        "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.cc",
+        "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.cc",
     ],
 }
 
diff --git a/BUILD b/BUILD
index 1d0f2e7..958d463 100644
--- a/BUILD
+++ b/BUILD
@@ -2102,14 +2102,14 @@
     srcs = [
         "src/trace_processor/perfetto_sql/engine/created_function.cc",
         "src/trace_processor/perfetto_sql/engine/created_function.h",
-        "src/trace_processor/perfetto_sql/engine/created_table_function.cc",
-        "src/trace_processor/perfetto_sql/engine/created_table_function.h",
         "src/trace_processor/perfetto_sql/engine/function_util.cc",
         "src/trace_processor/perfetto_sql/engine/function_util.h",
         "src/trace_processor/perfetto_sql/engine/perfetto_sql_engine.cc",
         "src/trace_processor/perfetto_sql/engine/perfetto_sql_engine.h",
         "src/trace_processor/perfetto_sql/engine/perfetto_sql_parser.cc",
         "src/trace_processor/perfetto_sql/engine/perfetto_sql_parser.h",
+        "src/trace_processor/perfetto_sql/engine/runtime_table_function.cc",
+        "src/trace_processor/perfetto_sql/engine/runtime_table_function.h",
     ],
 )
 
@@ -2165,8 +2165,8 @@
 perfetto_filegroup(
     name = "src_trace_processor_perfetto_sql_intrinsics_table_functions_interface",
     srcs = [
-        "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.cc",
-        "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h",
+        "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.cc",
+        "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h",
     ],
 )
 
diff --git a/src/trace_processor/perfetto_sql/engine/BUILD.gn b/src/trace_processor/perfetto_sql/engine/BUILD.gn
index 1e8950c..29d355f 100644
--- a/src/trace_processor/perfetto_sql/engine/BUILD.gn
+++ b/src/trace_processor/perfetto_sql/engine/BUILD.gn
@@ -20,14 +20,14 @@
   sources = [
     "created_function.cc",
     "created_function.h",
-    "created_table_function.cc",
-    "created_table_function.h",
     "function_util.cc",
     "function_util.h",
     "perfetto_sql_engine.cc",
     "perfetto_sql_engine.h",
     "perfetto_sql_parser.cc",
     "perfetto_sql_parser.h",
+    "runtime_table_function.cc",
+    "runtime_table_function.h",
   ]
   deps = [
     "../..:metatrace",
diff --git a/src/trace_processor/perfetto_sql/engine/perfetto_sql_engine.cc b/src/trace_processor/perfetto_sql/engine/perfetto_sql_engine.cc
index c2de3e3..dcb99fe 100644
--- a/src/trace_processor/perfetto_sql/engine/perfetto_sql_engine.cc
+++ b/src/trace_processor/perfetto_sql/engine/perfetto_sql_engine.cc
@@ -26,9 +26,9 @@
 #include "perfetto/ext/base/string_utils.h"
 #include "perfetto/ext/base/string_view.h"
 #include "src/trace_processor/perfetto_sql/engine/created_function.h"
-#include "src/trace_processor/perfetto_sql/engine/created_table_function.h"
 #include "src/trace_processor/perfetto_sql/engine/function_util.h"
 #include "src/trace_processor/perfetto_sql/engine/perfetto_sql_parser.h"
+#include "src/trace_processor/perfetto_sql/engine/runtime_table_function.h"
 #include "src/trace_processor/sqlite/db_sqlite_table.h"
 #include "src/trace_processor/sqlite/scoped_db.h"
 #include "src/trace_processor/sqlite/sql_source.h"
@@ -93,8 +93,8 @@
 
 PerfettoSqlEngine::PerfettoSqlEngine(StringPool* pool)
     : query_cache_(new QueryCache()), pool_(pool), engine_(new SqliteEngine()) {
-  engine_->RegisterVirtualTableModule<CreatedTableFunction>(
-      "created_table_function", this, SqliteTable::TableType::kExplicitCreate,
+  engine_->RegisterVirtualTableModule<RuntimeTableFunction>(
+      "runtime_table_function", this, SqliteTable::TableType::kExplicitCreate,
       false);
 }
 
@@ -102,11 +102,11 @@
   // Destroying the sqlite engine should also destroy all the created table
   // functions.
   engine_.reset();
-  PERFETTO_CHECK(created_table_function_state_.size() == 0);
+  PERFETTO_CHECK(runtime_table_fn_states_.size() == 0);
 }
 
-void PerfettoSqlEngine::RegisterTable(const Table& table,
-                                      const std::string& table_name) {
+void PerfettoSqlEngine::RegisterStaticTable(const Table& table,
+                                            const std::string& table_name) {
   DbSqliteTable::Context context{
       query_cache_.get(), DbSqliteTable::TableComputation::kStatic, &table,
       /*sql_table=*/nullptr, /*generator=*/nullptr};
@@ -127,8 +127,8 @@
   }
 }
 
-void PerfettoSqlEngine::RegisterTableFunction(
-    std::unique_ptr<TableFunction> fn) {
+void PerfettoSqlEngine::RegisterStaticTableFunction(
+    std::unique_ptr<StaticTableFunction> fn) {
   std::string table_name = fn->TableName();
   DbSqliteTable::Context context{
       query_cache_.get(), DbSqliteTable::TableComputation::kTableFunction,
@@ -183,7 +183,7 @@
     } else if (auto* cst = std::get_if<PerfettoSqlParser::CreateTable>(
                    &parser.statement())) {
       RETURN_IF_ERROR(AddTracebackIfNeeded(
-          RegisterSqlTable(cst->name, cst->sql), cst->sql));
+          RegisterRuntimeTable(cst->name, cst->sql), cst->sql));
       // Since the rest of the code requires a statement, just use a no-value
       // dummy statement.
       source = cst->sql.FullRewrite(
@@ -298,8 +298,8 @@
       std::move(*opt_return_type), std::move(return_type_str), std::move(sql));
 }
 
-base::Status PerfettoSqlEngine::RegisterSqlTable(std::string name,
-                                                 SqlSource sql) {
+base::Status PerfettoSqlEngine::RegisterRuntimeTable(std::string name,
+                                                     SqlSource sql) {
   auto stmt_or = engine_->PrepareStatement(sql);
   RETURN_IF_ERROR(stmt_or.status());
   SqliteEngine::PreparedStatement stmt = std::move(stmt_or);
@@ -389,7 +389,7 @@
         SqlSource::FromTraceProcessorImplementation("SELECT 0 WHERE 0"));
   }
 
-  CreatedTableFunction::State state{cf.prototype, cf.sql, {}, {}, std::nullopt};
+  RuntimeTableFunction::State state{cf.prototype, cf.sql, {}, {}, std::nullopt};
   base::StringView function_name;
   RETURN_IF_ERROR(
       ParseFunctionName(state.prototype_str.c_str(), function_name));
@@ -480,7 +480,7 @@
 
   std::string fn_name = state.prototype.function_name;
   std::string lower_name = base::ToLower(state.prototype.function_name);
-  if (created_table_function_state_.Find(lower_name)) {
+  if (runtime_table_fn_states_.Find(lower_name)) {
     if (!cf.replace) {
       return base::ErrStatus("Table function named %s already exists",
                              state.prototype.function_name.c_str());
@@ -493,26 +493,27 @@
     RETURN_IF_ERROR(res.status());
   }
 
-  auto it_and_inserted = created_table_function_state_.Insert(
+  auto it_and_inserted = runtime_table_fn_states_.Insert(
       lower_name,
-      std::make_unique<CreatedTableFunction::State>(std::move(state)));
+      std::make_unique<RuntimeTableFunction::State>(std::move(state)));
   PERFETTO_CHECK(it_and_inserted.second);
 
   base::StackString<1024> create(
-      "CREATE VIRTUAL TABLE %s USING created_table_function", fn_name.c_str());
+      "CREATE VIRTUAL TABLE %s USING runtime_table_function", fn_name.c_str());
   return cf.sql.FullRewrite(
       SqlSource::FromTraceProcessorImplementation(create.ToStdString()));
 }
 
-CreatedTableFunction::State* PerfettoSqlEngine::GetTableFunctionState(
+RuntimeTableFunction::State* PerfettoSqlEngine::GetRuntimeTableFunctionState(
     const std::string& name) const {
-  auto it = created_table_function_state_.Find(base::ToLower(name));
+  auto it = runtime_table_fn_states_.Find(base::ToLower(name));
   PERFETTO_CHECK(it);
   return it->get();
 }
 
-void PerfettoSqlEngine::OnTableFunctionDestroyed(const std::string& name) {
-  PERFETTO_CHECK(created_table_function_state_.Erase(base::ToLower(name)));
+void PerfettoSqlEngine::OnRuntimeTableFunctionDestroyed(
+    const std::string& name) {
+  PERFETTO_CHECK(runtime_table_fn_states_.Erase(base::ToLower(name)));
 }
 
 }  // namespace trace_processor
diff --git a/src/trace_processor/perfetto_sql/engine/perfetto_sql_engine.h b/src/trace_processor/perfetto_sql/engine/perfetto_sql_engine.h
index 9a9c3aa..4cf867a 100644
--- a/src/trace_processor/perfetto_sql/engine/perfetto_sql_engine.h
+++ b/src/trace_processor/perfetto_sql/engine/perfetto_sql_engine.h
@@ -23,10 +23,10 @@
 #include "perfetto/base/status.h"
 #include "perfetto/ext/base/flat_hash_map.h"
 #include "perfetto/ext/base/status_or.h"
-#include "src/trace_processor/perfetto_sql/engine/created_table_function.h"
 #include "src/trace_processor/perfetto_sql/engine/perfetto_sql_parser.h"
+#include "src/trace_processor/perfetto_sql/engine/runtime_table_function.h"
 #include "src/trace_processor/perfetto_sql/intrinsics/functions/sql_function.h"
-#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
 #include "src/trace_processor/sqlite/scoped_db.h"
 #include "src/trace_processor/sqlite/sql_source.h"
 #include "src/trace_processor/sqlite/sqlite_engine.h"
@@ -113,16 +113,17 @@
 
   // Registers a trace processor C++ table with SQLite with an SQL name of
   // |name|.
-  void RegisterTable(const Table& table, const std::string& name);
+  void RegisterStaticTable(const Table& table, const std::string& name);
 
   // Registers a trace processor C++ table function with SQLite.
-  void RegisterTableFunction(std::unique_ptr<TableFunction> fn);
+  void RegisterStaticTableFunction(std::unique_ptr<StaticTableFunction> fn);
 
   // Returns the state for the given table function.
-  CreatedTableFunction::State* GetTableFunctionState(const std::string&) const;
+  RuntimeTableFunction::State* GetRuntimeTableFunctionState(
+      const std::string&) const;
 
   // Should be called when a table function is destroyed.
-  void OnTableFunctionDestroyed(const std::string&);
+  void OnRuntimeTableFunctionDestroyed(const std::string&);
 
   SqliteEngine* sqlite_engine() { return engine_.get(); }
 
@@ -131,12 +132,12 @@
       const PerfettoSqlParser::CreateFunction&);
 
   // Registers a SQL-defined trace processor C++ table with SQLite.
-  base::Status RegisterSqlTable(std::string name, SqlSource sql);
+  base::Status RegisterRuntimeTable(std::string name, SqlSource sql);
 
   std::unique_ptr<QueryCache> query_cache_;
   StringPool* pool_ = nullptr;
-  base::FlatHashMap<std::string, std::unique_ptr<CreatedTableFunction::State>>
-      created_table_function_state_;
+  base::FlatHashMap<std::string, std::unique_ptr<RuntimeTableFunction::State>>
+      runtime_table_fn_states_;
   std::unique_ptr<SqliteEngine> engine_;
 };
 
diff --git a/src/trace_processor/perfetto_sql/engine/created_table_function.cc b/src/trace_processor/perfetto_sql/engine/runtime_table_function.cc
similarity index 90%
rename from src/trace_processor/perfetto_sql/engine/created_table_function.cc
rename to src/trace_processor/perfetto_sql/engine/runtime_table_function.cc
index 22ef34a..7804e7a 100644
--- a/src/trace_processor/perfetto_sql/engine/created_table_function.cc
+++ b/src/trace_processor/perfetto_sql/engine/runtime_table_function.cc
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "src/trace_processor/perfetto_sql/engine/created_table_function.h"
+#include "src/trace_processor/perfetto_sql/engine/runtime_table_function.h"
 
 #include <optional>
 #include <utility>
@@ -34,24 +34,24 @@
 
 }  // namespace
 
-CreatedTableFunction::CreatedTableFunction(sqlite3*, PerfettoSqlEngine* engine)
+RuntimeTableFunction::RuntimeTableFunction(sqlite3*, PerfettoSqlEngine* engine)
     : engine_(engine) {}
 
-CreatedTableFunction::~CreatedTableFunction() {
-  engine_->OnTableFunctionDestroyed(name());
+RuntimeTableFunction::~RuntimeTableFunction() {
+  engine_->OnRuntimeTableFunctionDestroyed(name());
 }
 
-base::Status CreatedTableFunction::Init(int,
+base::Status RuntimeTableFunction::Init(int,
                                         const char* const*,
                                         Schema* schema) {
-  state_ = engine_->GetTableFunctionState(name());
+  state_ = engine_->GetRuntimeTableFunctionState(name());
 
   // Now we've parsed prototype and return values, create the schema.
   *schema = CreateSchema();
   return base::OkStatus();
 }
 
-SqliteTable::Schema CreatedTableFunction::CreateSchema() {
+SqliteTable::Schema RuntimeTableFunction::CreateSchema() {
   std::vector<Column> columns;
   for (size_t i = 0; i < state_->return_values.size(); ++i) {
     const auto& ret = state_->return_values[i];
@@ -82,11 +82,11 @@
   return SqliteTable::Schema(std::move(columns), std::move(primary_keys));
 }
 
-std::unique_ptr<SqliteTable::BaseCursor> CreatedTableFunction::CreateCursor() {
+std::unique_ptr<SqliteTable::BaseCursor> RuntimeTableFunction::CreateCursor() {
   return std::unique_ptr<Cursor>(new Cursor(this, state_));
 }
 
-int CreatedTableFunction::BestIndex(const QueryConstraints& qc,
+int RuntimeTableFunction::BestIndex(const QueryConstraints& qc,
                                     BestIndexInfo* info) {
   // Only accept constraint sets where every input parameter has a value.
   size_t seen_argument_constraints = 0;
@@ -107,7 +107,7 @@
   return SQLITE_OK;
 }
 
-CreatedTableFunction::Cursor::Cursor(CreatedTableFunction* table, State* state)
+RuntimeTableFunction::Cursor::Cursor(RuntimeTableFunction* table, State* state)
     : SqliteTable::BaseCursor(table), table_(table), state_(state) {
   if (state->reusable_stmt) {
     stmt_ = std::move(state->reusable_stmt);
@@ -116,14 +116,14 @@
   }
 }
 
-CreatedTableFunction::Cursor::~Cursor() {
+RuntimeTableFunction::Cursor::~Cursor() {
   if (return_stmt_to_state_) {
     ResetStatement(stmt_->sqlite_stmt());
     state_->reusable_stmt = std::move(stmt_);
   }
 }
 
-base::Status CreatedTableFunction::Cursor::Filter(const QueryConstraints& qc,
+base::Status RuntimeTableFunction::Cursor::Filter(const QueryConstraints& qc,
                                                   sqlite3_value** argv,
                                                   FilterHistory) {
   PERFETTO_TP_TRACE(metatrace::Category::FUNCTION, "TABLE_FUNCTION_CALL",
@@ -216,17 +216,17 @@
   return Next();
 }
 
-base::Status CreatedTableFunction::Cursor::Next() {
+base::Status RuntimeTableFunction::Cursor::Next() {
   is_eof_ = !stmt_->Step();
   next_call_count_++;
   return stmt_->status();
 }
 
-bool CreatedTableFunction::Cursor::Eof() {
+bool RuntimeTableFunction::Cursor::Eof() {
   return is_eof_;
 }
 
-base::Status CreatedTableFunction::Cursor::Column(sqlite3_context* ctx, int i) {
+base::Status RuntimeTableFunction::Cursor::Column(sqlite3_context* ctx, int i) {
   size_t idx = static_cast<size_t>(i);
   if (state_->IsReturnValueColumn(idx)) {
     sqlite3_result_value(ctx, sqlite3_column_value(stmt_->sqlite_stmt(), i));
diff --git a/src/trace_processor/perfetto_sql/engine/created_table_function.h b/src/trace_processor/perfetto_sql/engine/runtime_table_function.h
similarity index 82%
rename from src/trace_processor/perfetto_sql/engine/created_table_function.h
rename to src/trace_processor/perfetto_sql/engine/runtime_table_function.h
index 8ae3ca2..9fe8c6e 100644
--- a/src/trace_processor/perfetto_sql/engine/created_table_function.h
+++ b/src/trace_processor/perfetto_sql/engine/runtime_table_function.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef SRC_TRACE_PROCESSOR_PERFETTO_SQL_ENGINE_CREATED_TABLE_FUNCTION_H_
-#define SRC_TRACE_PROCESSOR_PERFETTO_SQL_ENGINE_CREATED_TABLE_FUNCTION_H_
+#ifndef SRC_TRACE_PROCESSOR_PERFETTO_SQL_ENGINE_RUNTIME_TABLE_FUNCTION_H_
+#define SRC_TRACE_PROCESSOR_PERFETTO_SQL_ENGINE_RUNTIME_TABLE_FUNCTION_H_
 
 #include <optional>
 
@@ -29,11 +29,11 @@
 
 // The implementation of the SqliteTable interface for table functions defined
 // at runtime using SQL.
-class CreatedTableFunction final
-    : public TypedSqliteTable<CreatedTableFunction, PerfettoSqlEngine*> {
+class RuntimeTableFunction final
+    : public TypedSqliteTable<RuntimeTableFunction, PerfettoSqlEngine*> {
  public:
-  // The state of this function. This is separated from |CreatedTableFunction|
-  // because |CreatedTableFunction| is owned by Sqlite while |State| is owned by
+  // The state of this function. This is separated from |RuntimeTableFunction|
+  // because |RuntimeTableFunction| is owned by Sqlite while |State| is owned by
   // PerfettoSqlEngine.
   struct State {
     std::string prototype_str;
@@ -68,7 +68,7 @@
   };
   class Cursor final : public SqliteTable::BaseCursor {
    public:
-    explicit Cursor(CreatedTableFunction* table, State* state);
+    explicit Cursor(RuntimeTableFunction* table, State* state);
     ~Cursor() final;
 
     base::Status Filter(const QueryConstraints& qc,
@@ -79,7 +79,7 @@
     base::Status Column(sqlite3_context* context, int N);
 
    private:
-    CreatedTableFunction* table_ = nullptr;
+    RuntimeTableFunction* table_ = nullptr;
     State* state_ = nullptr;
 
     std::optional<SqliteEngine::PreparedStatement> stmt_;
@@ -89,8 +89,8 @@
     int next_call_count_ = 0;
   };
 
-  CreatedTableFunction(sqlite3*, PerfettoSqlEngine*);
-  ~CreatedTableFunction() final;
+  RuntimeTableFunction(sqlite3*, PerfettoSqlEngine*);
+  ~RuntimeTableFunction() final;
 
   base::Status Init(int argc, const char* const* argv, Schema*) final;
   std::unique_ptr<SqliteTable::BaseCursor> CreateCursor() final;
@@ -106,4 +106,4 @@
 }  // namespace trace_processor
 }  // namespace perfetto
 
-#endif  // SRC_TRACE_PROCESSOR_PERFETTO_SQL_ENGINE_CREATED_TABLE_FUNCTION_H_
+#endif  // SRC_TRACE_PROCESSOR_PERFETTO_SQL_ENGINE_RUNTIME_TABLE_FUNCTION_H_
diff --git a/src/trace_processor/perfetto_sql/intrinsics/table_functions/BUILD.gn b/src/trace_processor/perfetto_sql/intrinsics/table_functions/BUILD.gn
index 46e6e68..1375d9e 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/table_functions/BUILD.gn
+++ b/src/trace_processor/perfetto_sql/intrinsics/table_functions/BUILD.gn
@@ -62,8 +62,8 @@
 
 source_set("interface") {
   sources = [
-    "table_function.cc",
-    "table_function.h",
+    "static_table_function.cc",
+    "static_table_function.h",
   ]
   deps = [
     "../../../../../gn:default_deps",
diff --git a/src/trace_processor/perfetto_sql/intrinsics/table_functions/ancestor.h b/src/trace_processor/perfetto_sql/intrinsics/table_functions/ancestor.h
index a2dfce2..4aa8bd2 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/table_functions/ancestor.h
+++ b/src/trace_processor/perfetto_sql/intrinsics/table_functions/ancestor.h
@@ -19,7 +19,7 @@
 
 #include <optional>
 
-#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
 #include "src/trace_processor/storage/trace_storage.h"
 
 namespace perfetto {
@@ -33,7 +33,7 @@
 // * ancestor_slice_by_stack
 //
 // See docs/analysis/trace-processor for usage.
-class Ancestor : public TableFunction {
+class Ancestor : public StaticTableFunction {
  public:
   enum class Type { kSlice = 1, kStackProfileCallsite = 2, kSliceByStack = 3 };
 
diff --git a/src/trace_processor/perfetto_sql/intrinsics/table_functions/connected_flow.h b/src/trace_processor/perfetto_sql/intrinsics/table_functions/connected_flow.h
index 9206968..6a7a804 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/table_functions/connected_flow.h
+++ b/src/trace_processor/perfetto_sql/intrinsics/table_functions/connected_flow.h
@@ -17,7 +17,7 @@
 #ifndef SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_TABLE_FUNCTIONS_CONNECTED_FLOW_H_
 #define SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_TABLE_FUNCTIONS_CONNECTED_FLOW_H_
 
-#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
 #include "src/trace_processor/perfetto_sql/intrinsics/table_functions/tables_py.h"
 #include "src/trace_processor/storage/trace_storage.h"
 
@@ -33,7 +33,7 @@
 // - DIRECTLY_CONNECTED_FLOW
 // - PRECEDING_FLOW
 // - FOLLOWING_FLOW
-class ConnectedFlow : public TableFunction {
+class ConnectedFlow : public StaticTableFunction {
  public:
   enum class Mode {
     // Directly connected slices through the same flow ID given by the trace
diff --git a/src/trace_processor/perfetto_sql/intrinsics/table_functions/descendant.h b/src/trace_processor/perfetto_sql/intrinsics/table_functions/descendant.h
index aa0c220..2f7a870 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/table_functions/descendant.h
+++ b/src/trace_processor/perfetto_sql/intrinsics/table_functions/descendant.h
@@ -19,7 +19,7 @@
 
 #include <optional>
 
-#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
 #include "src/trace_processor/storage/trace_storage.h"
 
 namespace perfetto {
@@ -32,7 +32,7 @@
 // * descendant_slice_by_stack
 //
 // See docs/analysis/trace-processor for usage.
-class Descendant : public TableFunction {
+class Descendant : public StaticTableFunction {
  public:
   enum class Type { kSlice = 1, kSliceByStack = 2 };
 
diff --git a/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_annotated_stack.h b/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_annotated_stack.h
index 49878a3..193386b 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_annotated_stack.h
+++ b/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_annotated_stack.h
@@ -17,7 +17,7 @@
 #ifndef SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_TABLE_FUNCTIONS_EXPERIMENTAL_ANNOTATED_STACK_H_
 #define SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_TABLE_FUNCTIONS_EXPERIMENTAL_ANNOTATED_STACK_H_
 
-#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
 
 namespace perfetto {
 namespace trace_processor {
@@ -29,7 +29,7 @@
 // Given a leaf callsite id, returns the full callstack (including the leaf),
 // with optional (currently Android-specific) annotations. A given callsite will
 // always have the same annotation.
-class ExperimentalAnnotatedStack : public TableFunction {
+class ExperimentalAnnotatedStack : public StaticTableFunction {
  public:
   explicit ExperimentalAnnotatedStack(TraceProcessorContext* context)
       : context_(context) {}
diff --git a/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_counter_dur.h b/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_counter_dur.h
index 038bcb0..045c8e2 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_counter_dur.h
+++ b/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_counter_dur.h
@@ -17,13 +17,13 @@
 #ifndef SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_TABLE_FUNCTIONS_EXPERIMENTAL_COUNTER_DUR_H_
 #define SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_TABLE_FUNCTIONS_EXPERIMENTAL_COUNTER_DUR_H_
 
-#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
 #include "src/trace_processor/storage/trace_storage.h"
 
 namespace perfetto {
 namespace trace_processor {
 
-class ExperimentalCounterDur : public TableFunction {
+class ExperimentalCounterDur : public StaticTableFunction {
  public:
   using CounterTable = tables::CounterTable;
 
diff --git a/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_flamegraph.h b/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_flamegraph.h
index 8a4cae5..6bc172f 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_flamegraph.h
+++ b/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_flamegraph.h
@@ -18,7 +18,7 @@
 #define SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_TABLE_FUNCTIONS_EXPERIMENTAL_FLAMEGRAPH_H_
 
 #include "src/trace_processor/perfetto_sql/intrinsics/table_functions/flamegraph_construction_algorithms.h"
-#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
 #include "src/trace_processor/storage/trace_storage.h"
 
 namespace perfetto {
@@ -26,7 +26,7 @@
 
 class TraceProcessorContext;
 
-class ExperimentalFlamegraph : public TableFunction {
+class ExperimentalFlamegraph : public StaticTableFunction {
  public:
   enum class ProfileType { kGraph, kHeapProfile, kPerf };
 
diff --git a/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_flat_slice.h b/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_flat_slice.h
index 218923e..e9423ed 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_flat_slice.h
+++ b/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_flat_slice.h
@@ -19,7 +19,7 @@
 
 #include <optional>
 
-#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
 #include "src/trace_processor/storage/trace_storage.h"
 
 namespace perfetto {
@@ -53,7 +53,7 @@
 // (which picks all slices with ts + dur >= bound) and is more akin to doing
 // a simple ts >= bound. However, slices *will* be truncated at the end
 // if they would spill past the provided end bound.
-class ExperimentalFlatSlice : public TableFunction {
+class ExperimentalFlatSlice : public StaticTableFunction {
  public:
   ExperimentalFlatSlice(TraceProcessorContext* context);
 
diff --git a/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_sched_upid.h b/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_sched_upid.h
index 800e933..41ff35c 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_sched_upid.h
+++ b/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_sched_upid.h
@@ -19,13 +19,13 @@
 
 #include <set>
 
-#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
 #include "src/trace_processor/storage/trace_storage.h"
 
 namespace perfetto {
 namespace trace_processor {
 
-class ExperimentalSchedUpid : public TableFunction {
+class ExperimentalSchedUpid : public StaticTableFunction {
  public:
   ExperimentalSchedUpid(const tables::SchedSliceTable&,
                         const tables::ThreadTable&);
diff --git a/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_slice_layout.h b/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_slice_layout.h
index d23c628..9fcd299 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_slice_layout.h
+++ b/src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_slice_layout.h
@@ -19,13 +19,13 @@
 
 #include <set>
 
-#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
 #include "src/trace_processor/storage/trace_storage.h"
 
 namespace perfetto {
 namespace trace_processor {
 
-class ExperimentalSliceLayout : public TableFunction {
+class ExperimentalSliceLayout : public StaticTableFunction {
  public:
   ExperimentalSliceLayout(StringPool* string_pool,
                           const tables::SliceTable* table);
diff --git a/src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.cc b/src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.cc
similarity index 90%
rename from src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.cc
rename to src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.cc
index 770f51f..0799e13 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.cc
+++ b/src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.cc
@@ -14,12 +14,12 @@
  * limitations under the License.
  */
 
-#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
 
 namespace perfetto {
 namespace trace_processor {
 
-TableFunction::~TableFunction() = default;
+StaticTableFunction::~StaticTableFunction() = default;
 
 }  // namespace trace_processor
 }  // namespace perfetto
diff --git a/src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h b/src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h
similarity index 94%
rename from src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h
rename to src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h
index 4079603..75b6c79 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h
+++ b/src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_TABLE_FUNCTIONS_TABLE_FUNCTION_H_
-#define SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_TABLE_FUNCTIONS_TABLE_FUNCTION_H_
+#ifndef SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_TABLE_FUNCTIONS_STATIC_TABLE_FUNCTION_H_
+#define SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_TABLE_FUNCTIONS_STATIC_TABLE_FUNCTION_H_
 
 #include "perfetto/base/status.h"
 #include "src/trace_processor/db/table.h"
@@ -28,9 +28,9 @@
 // at filter time.
 // This class is used to implement table-valued functions and other similar
 // tables.
-class TableFunction {
+class StaticTableFunction {
  public:
-  virtual ~TableFunction();
+  virtual ~StaticTableFunction();
 
   // Returns the schema of the table that will be returned by ComputeTable.
   virtual Table::Schema CreateSchema() = 0;
@@ -62,4 +62,4 @@
 }  // namespace trace_processor
 }  // namespace perfetto
 
-#endif  // SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_TABLE_FUNCTIONS_TABLE_FUNCTION_H_
+#endif  // SRC_TRACE_PROCESSOR_PERFETTO_SQL_INTRINSICS_TABLE_FUNCTIONS_STATIC_TABLE_FUNCTION_H_
diff --git a/src/trace_processor/perfetto_sql/intrinsics/table_functions/view.cc b/src/trace_processor/perfetto_sql/intrinsics/table_functions/view.cc
index fca72a4..1055357 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/table_functions/view.cc
+++ b/src/trace_processor/perfetto_sql/intrinsics/table_functions/view.cc
@@ -19,32 +19,35 @@
 namespace perfetto {
 namespace trace_processor {
 
-ViewTableFunction::ViewTableFunction(const View* view, const char* name)
+ViewStaticTableFunction::ViewStaticTableFunction(const View* view,
+                                                 const char* name)
     : view_(view), name_(name) {}
 
-ViewTableFunction::~ViewTableFunction() = default;
+ViewStaticTableFunction::~ViewStaticTableFunction() = default;
 
-base::Status ViewTableFunction::ValidateConstraints(const QueryConstraints&) {
+base::Status ViewStaticTableFunction::ValidateConstraints(
+    const QueryConstraints&) {
   return base::OkStatus();
 }
 
-base::Status ViewTableFunction::ComputeTable(const std::vector<Constraint>& cs,
-                                             const std::vector<Order>& ob,
-                                             const BitVector& cols_used,
-                                             std::unique_ptr<Table>& table) {
+base::Status ViewStaticTableFunction::ComputeTable(
+    const std::vector<Constraint>& cs,
+    const std::vector<Order>& ob,
+    const BitVector& cols_used,
+    std::unique_ptr<Table>& table) {
   table.reset(new Table(view_->Query(cs, ob, cols_used)));
   return base::OkStatus();
 }
 
-Table::Schema ViewTableFunction::CreateSchema() {
+Table::Schema ViewStaticTableFunction::CreateSchema() {
   return view_->schema();
 }
 
-std::string ViewTableFunction::TableName() {
+std::string ViewStaticTableFunction::TableName() {
   return name_;
 }
 
-uint32_t ViewTableFunction::EstimateRowCount() {
+uint32_t ViewStaticTableFunction::EstimateRowCount() {
   return view_->EstimateRowCount();
 }
 
diff --git a/src/trace_processor/perfetto_sql/intrinsics/table_functions/view.h b/src/trace_processor/perfetto_sql/intrinsics/table_functions/view.h
index 79b3a5c..0bb4648 100644
--- a/src/trace_processor/perfetto_sql/intrinsics/table_functions/view.h
+++ b/src/trace_processor/perfetto_sql/intrinsics/table_functions/view.h
@@ -19,16 +19,16 @@
 
 #include "perfetto/ext/base/flat_hash_map.h"
 #include "src/trace_processor/db/view.h"
-#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
 #include "src/trace_processor/storage/trace_storage.h"
 
 namespace perfetto {
 namespace trace_processor {
 
-class ViewTableFunction : public TableFunction {
+class ViewStaticTableFunction : public StaticTableFunction {
  public:
-  explicit ViewTableFunction(const View*, const char* name);
-  ~ViewTableFunction() override;
+  explicit ViewStaticTableFunction(const View*, const char* name);
+  ~ViewStaticTableFunction() override;
 
   Table::Schema CreateSchema() override;
   std::string TableName() override;
diff --git a/src/trace_processor/sqlite/db_sqlite_table.h b/src/trace_processor/sqlite/db_sqlite_table.h
index e9c793d..940a65d 100644
--- a/src/trace_processor/sqlite/db_sqlite_table.h
+++ b/src/trace_processor/sqlite/db_sqlite_table.h
@@ -21,7 +21,7 @@
 #include "src/trace_processor/containers/bit_vector.h"
 #include "src/trace_processor/db/runtime_table.h"
 #include "src/trace_processor/db/table.h"
-#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
 #include "src/trace_processor/sqlite/query_cache.h"
 #include "src/trace_processor/sqlite/sqlite_table.h"
 
@@ -29,14 +29,13 @@
 namespace trace_processor {
 
 enum class DbSqliteTableComputation {
-  // Mode when the table is static (i.e. passed in at construction
-  // time).
+  // Table is statically defined.
   kStatic,
 
-  // Mode when table is dynamically computed at filter time.
+  // Table is defined as a function.
   kTableFunction,
 
-  // Mode when table is dynamically computer at SQL runtime.
+  // Table is defined in runtime.
   kRuntime
 };
 
@@ -47,11 +46,11 @@
   // Only valid when computation == TableComputation::kStatic.
   const Table* static_table;
 
-  // Only valid when computation == TableComputation::kSql.
+  // Only valid when computation == TableComputation::kRuntime.
   std::unique_ptr<RuntimeTable> sql_table;
 
-  // Only valid when computation == TableComputation::kDynamic.
-  std::unique_ptr<TableFunction> generator;
+  // Only valid when computation == TableComputation::kTableFunction.
+  std::unique_ptr<StaticTableFunction> generator;
 };
 
 // Implements the SQLite table interface for db tables.
@@ -171,8 +170,8 @@
   // Only valid when computation_ == TableComputation::kSql.
   std::unique_ptr<RuntimeTable> sql_table_;
 
-  // Only valid when computation_ == TableComputation::kDynamic.
-  std::unique_ptr<TableFunction> generator_;
+  // Only valid when computation_ == TableComputation::kTableFunction.
+  std::unique_ptr<StaticTableFunction> generator_;
 };
 
 }  // namespace trace_processor
diff --git a/src/trace_processor/sqlite/sqlite_table.h b/src/trace_processor/sqlite/sqlite_table.h
index b530870..245fe7c 100644
--- a/src/trace_processor/sqlite/sqlite_table.h
+++ b/src/trace_processor/sqlite/sqlite_table.h
@@ -231,13 +231,12 @@
 
   // This name of the table. For tables created using CREATE VIRTUAL TABLE, this
   // will be the name of the table specified by the query. For automatically
-  // created tables, this will be the same as the module name passed to
-  // RegisterTable.
+  // created tables, this will be the same as the module name registered.
   std::string name_;
 
-  // The module name is the name passed to RegisterTable. This is differs from
-  // the table name (|name_|) where the table was created using CREATE VIRTUAL
-  // TABLE.
+  // The module name is the name that will be registered. This is
+  // differs from the table name (|name_|) where the table was created using
+  // CREATE VIRTUAL TABLE.
   std::string module_name_;
 
   Schema schema_;
diff --git a/src/trace_processor/trace_processor_impl.cc b/src/trace_processor/trace_processor_impl.cc
index 23e62ef..6a9edd9 100644
--- a/src/trace_processor/trace_processor_impl.cc
+++ b/src/trace_processor/trace_processor_impl.cc
@@ -74,7 +74,7 @@
 #include "src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_flat_slice.h"
 #include "src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_sched_upid.h"
 #include "src/trace_processor/perfetto_sql/intrinsics/table_functions/experimental_slice_layout.h"
-#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/table_function.h"
+#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
 #include "src/trace_processor/perfetto_sql/intrinsics/table_functions/view.h"
 #include "src/trace_processor/perfetto_sql/prelude/tables_views.h"
 #include "src/trace_processor/perfetto_sql/stdlib/stdlib.h"
@@ -359,8 +359,8 @@
 
 template <typename View>
 void TraceProcessorImpl::RegisterView(const View& view) {
-  RegisterTableFunction(std::unique_ptr<TableFunction>(
-      new ViewTableFunction(&view, View::Name())));
+  RegisterStaticTableFunction(std::unique_ptr<StaticTableFunction>(
+      new ViewStaticTableFunction(&view, View::Name())));
 }
 
 TraceProcessorImpl::TraceProcessorImpl(const Config& cfg)
@@ -500,35 +500,35 @@
       "stats", storage, SqliteTable::TableType::kEponymousOnly, false);
 
   // Tables dynamically generated at query time.
-  RegisterTableFunction(std::unique_ptr<ExperimentalFlamegraph>(
+  RegisterStaticTableFunction(std::unique_ptr<ExperimentalFlamegraph>(
       new ExperimentalFlamegraph(&context_)));
-  RegisterTableFunction(std::unique_ptr<ExperimentalCounterDur>(
+  RegisterStaticTableFunction(std::unique_ptr<ExperimentalCounterDur>(
       new ExperimentalCounterDur(storage->counter_table())));
-  RegisterTableFunction(std::unique_ptr<ExperimentalSliceLayout>(
+  RegisterStaticTableFunction(std::unique_ptr<ExperimentalSliceLayout>(
       new ExperimentalSliceLayout(context_.storage.get()->mutable_string_pool(),
                                   &storage->slice_table())));
-  RegisterTableFunction(std::unique_ptr<Ancestor>(
+  RegisterStaticTableFunction(std::unique_ptr<Ancestor>(
       new Ancestor(Ancestor::Type::kSlice, context_.storage.get())));
-  RegisterTableFunction(std::unique_ptr<Ancestor>(new Ancestor(
+  RegisterStaticTableFunction(std::unique_ptr<Ancestor>(new Ancestor(
       Ancestor::Type::kStackProfileCallsite, context_.storage.get())));
-  RegisterTableFunction(std::unique_ptr<Ancestor>(
+  RegisterStaticTableFunction(std::unique_ptr<Ancestor>(
       new Ancestor(Ancestor::Type::kSliceByStack, context_.storage.get())));
-  RegisterTableFunction(std::unique_ptr<Descendant>(
+  RegisterStaticTableFunction(std::unique_ptr<Descendant>(
       new Descendant(Descendant::Type::kSlice, context_.storage.get())));
-  RegisterTableFunction(std::unique_ptr<Descendant>(
+  RegisterStaticTableFunction(std::unique_ptr<Descendant>(
       new Descendant(Descendant::Type::kSliceByStack, context_.storage.get())));
-  RegisterTableFunction(std::unique_ptr<ConnectedFlow>(new ConnectedFlow(
+  RegisterStaticTableFunction(std::unique_ptr<ConnectedFlow>(new ConnectedFlow(
       ConnectedFlow::Mode::kDirectlyConnectedFlow, context_.storage.get())));
-  RegisterTableFunction(std::unique_ptr<ConnectedFlow>(new ConnectedFlow(
+  RegisterStaticTableFunction(std::unique_ptr<ConnectedFlow>(new ConnectedFlow(
       ConnectedFlow::Mode::kPrecedingFlow, context_.storage.get())));
-  RegisterTableFunction(std::unique_ptr<ConnectedFlow>(new ConnectedFlow(
+  RegisterStaticTableFunction(std::unique_ptr<ConnectedFlow>(new ConnectedFlow(
       ConnectedFlow::Mode::kFollowingFlow, context_.storage.get())));
-  RegisterTableFunction(
+  RegisterStaticTableFunction(
       std::unique_ptr<ExperimentalSchedUpid>(new ExperimentalSchedUpid(
           storage->sched_slice_table(), storage->thread_table())));
-  RegisterTableFunction(std::unique_ptr<ExperimentalAnnotatedStack>(
+  RegisterStaticTableFunction(std::unique_ptr<ExperimentalAnnotatedStack>(
       new ExperimentalAnnotatedStack(&context_)));
-  RegisterTableFunction(std::unique_ptr<ExperimentalFlatSlice>(
+  RegisterStaticTableFunction(std::unique_ptr<ExperimentalFlatSlice>(
       new ExperimentalFlatSlice(&context_)));
 
   // Views.
@@ -538,85 +538,85 @@
   // Note: if adding a table here which might potentially contain many rows
   // (O(rows in sched/slice/counter)), then consider calling ShrinkToFit on
   // that table in TraceStorage::ShrinkToFitTables.
-  RegisterDbTable(storage->arg_table());
-  RegisterDbTable(storage->raw_table());
-  RegisterDbTable(storage->ftrace_event_table());
-  RegisterDbTable(storage->thread_table());
-  RegisterDbTable(storage->process_table());
-  RegisterDbTable(storage->filedescriptor_table());
+  RegisterStaticTable(storage->arg_table());
+  RegisterStaticTable(storage->raw_table());
+  RegisterStaticTable(storage->ftrace_event_table());
+  RegisterStaticTable(storage->thread_table());
+  RegisterStaticTable(storage->process_table());
+  RegisterStaticTable(storage->filedescriptor_table());
 
-  RegisterDbTable(storage->slice_table());
-  RegisterDbTable(storage->flow_table());
-  RegisterDbTable(storage->slice_table());
-  RegisterDbTable(storage->sched_slice_table());
-  RegisterDbTable(storage->spurious_sched_wakeup_table());
-  RegisterDbTable(storage->thread_state_table());
-  RegisterDbTable(storage->gpu_slice_table());
+  RegisterStaticTable(storage->slice_table());
+  RegisterStaticTable(storage->flow_table());
+  RegisterStaticTable(storage->slice_table());
+  RegisterStaticTable(storage->sched_slice_table());
+  RegisterStaticTable(storage->spurious_sched_wakeup_table());
+  RegisterStaticTable(storage->thread_state_table());
+  RegisterStaticTable(storage->gpu_slice_table());
 
-  RegisterDbTable(storage->track_table());
-  RegisterDbTable(storage->thread_track_table());
-  RegisterDbTable(storage->process_track_table());
-  RegisterDbTable(storage->cpu_track_table());
-  RegisterDbTable(storage->gpu_track_table());
+  RegisterStaticTable(storage->track_table());
+  RegisterStaticTable(storage->thread_track_table());
+  RegisterStaticTable(storage->process_track_table());
+  RegisterStaticTable(storage->cpu_track_table());
+  RegisterStaticTable(storage->gpu_track_table());
 
-  RegisterDbTable(storage->counter_table());
+  RegisterStaticTable(storage->counter_table());
 
-  RegisterDbTable(storage->counter_track_table());
-  RegisterDbTable(storage->process_counter_track_table());
-  RegisterDbTable(storage->thread_counter_track_table());
-  RegisterDbTable(storage->cpu_counter_track_table());
-  RegisterDbTable(storage->irq_counter_track_table());
-  RegisterDbTable(storage->softirq_counter_track_table());
-  RegisterDbTable(storage->gpu_counter_track_table());
-  RegisterDbTable(storage->gpu_counter_group_table());
-  RegisterDbTable(storage->perf_counter_track_table());
-  RegisterDbTable(storage->energy_counter_track_table());
-  RegisterDbTable(storage->uid_counter_track_table());
-  RegisterDbTable(storage->energy_per_uid_counter_track_table());
+  RegisterStaticTable(storage->counter_track_table());
+  RegisterStaticTable(storage->process_counter_track_table());
+  RegisterStaticTable(storage->thread_counter_track_table());
+  RegisterStaticTable(storage->cpu_counter_track_table());
+  RegisterStaticTable(storage->irq_counter_track_table());
+  RegisterStaticTable(storage->softirq_counter_track_table());
+  RegisterStaticTable(storage->gpu_counter_track_table());
+  RegisterStaticTable(storage->gpu_counter_group_table());
+  RegisterStaticTable(storage->perf_counter_track_table());
+  RegisterStaticTable(storage->energy_counter_track_table());
+  RegisterStaticTable(storage->uid_counter_track_table());
+  RegisterStaticTable(storage->energy_per_uid_counter_track_table());
 
-  RegisterDbTable(storage->heap_graph_object_table());
-  RegisterDbTable(storage->heap_graph_reference_table());
-  RegisterDbTable(storage->heap_graph_class_table());
+  RegisterStaticTable(storage->heap_graph_object_table());
+  RegisterStaticTable(storage->heap_graph_reference_table());
+  RegisterStaticTable(storage->heap_graph_class_table());
 
-  RegisterDbTable(storage->symbol_table());
-  RegisterDbTable(storage->heap_profile_allocation_table());
-  RegisterDbTable(storage->cpu_profile_stack_sample_table());
-  RegisterDbTable(storage->perf_sample_table());
-  RegisterDbTable(storage->stack_profile_callsite_table());
-  RegisterDbTable(storage->stack_profile_mapping_table());
-  RegisterDbTable(storage->stack_profile_frame_table());
-  RegisterDbTable(storage->package_list_table());
-  RegisterDbTable(storage->profiler_smaps_table());
+  RegisterStaticTable(storage->symbol_table());
+  RegisterStaticTable(storage->heap_profile_allocation_table());
+  RegisterStaticTable(storage->cpu_profile_stack_sample_table());
+  RegisterStaticTable(storage->perf_sample_table());
+  RegisterStaticTable(storage->stack_profile_callsite_table());
+  RegisterStaticTable(storage->stack_profile_mapping_table());
+  RegisterStaticTable(storage->stack_profile_frame_table());
+  RegisterStaticTable(storage->package_list_table());
+  RegisterStaticTable(storage->profiler_smaps_table());
 
-  RegisterDbTable(storage->android_log_table());
-  RegisterDbTable(storage->android_dumpstate_table());
-  RegisterDbTable(storage->android_game_intervention_list_table());
+  RegisterStaticTable(storage->android_log_table());
+  RegisterStaticTable(storage->android_dumpstate_table());
+  RegisterStaticTable(storage->android_game_intervention_list_table());
 
-  RegisterDbTable(storage->vulkan_memory_allocations_table());
+  RegisterStaticTable(storage->vulkan_memory_allocations_table());
 
-  RegisterDbTable(storage->graphics_frame_slice_table());
+  RegisterStaticTable(storage->graphics_frame_slice_table());
 
-  RegisterDbTable(storage->expected_frame_timeline_slice_table());
-  RegisterDbTable(storage->actual_frame_timeline_slice_table());
+  RegisterStaticTable(storage->expected_frame_timeline_slice_table());
+  RegisterStaticTable(storage->actual_frame_timeline_slice_table());
 
-  RegisterDbTable(storage->surfaceflinger_layers_snapshot_table());
-  RegisterDbTable(storage->surfaceflinger_layer_table());
-  RegisterDbTable(storage->surfaceflinger_transactions_table());
+  RegisterStaticTable(storage->surfaceflinger_layers_snapshot_table());
+  RegisterStaticTable(storage->surfaceflinger_layer_table());
+  RegisterStaticTable(storage->surfaceflinger_transactions_table());
 
-  RegisterDbTable(storage->metadata_table());
-  RegisterDbTable(storage->cpu_table());
-  RegisterDbTable(storage->cpu_freq_table());
-  RegisterDbTable(storage->clock_snapshot_table());
+  RegisterStaticTable(storage->metadata_table());
+  RegisterStaticTable(storage->cpu_table());
+  RegisterStaticTable(storage->cpu_freq_table());
+  RegisterStaticTable(storage->clock_snapshot_table());
 
-  RegisterDbTable(storage->memory_snapshot_table());
-  RegisterDbTable(storage->process_memory_snapshot_table());
-  RegisterDbTable(storage->memory_snapshot_node_table());
-  RegisterDbTable(storage->memory_snapshot_edge_table());
+  RegisterStaticTable(storage->memory_snapshot_table());
+  RegisterStaticTable(storage->process_memory_snapshot_table());
+  RegisterStaticTable(storage->memory_snapshot_node_table());
+  RegisterStaticTable(storage->memory_snapshot_edge_table());
 
-  RegisterDbTable(storage->experimental_proto_path_table());
-  RegisterDbTable(storage->experimental_proto_content_table());
+  RegisterStaticTable(storage->experimental_proto_path_table());
+  RegisterStaticTable(storage->experimental_proto_content_table());
 
-  RegisterDbTable(storage->experimental_missing_chrome_processes_table());
+  RegisterStaticTable(storage->experimental_missing_chrome_processes_table());
 }
 
 TraceProcessorImpl::~TraceProcessorImpl() = default;
diff --git a/src/trace_processor/trace_processor_impl.h b/src/trace_processor/trace_processor_impl.h
index 0cf6410..b869a63 100644
--- a/src/trace_processor/trace_processor_impl.h
+++ b/src/trace_processor/trace_processor_impl.h
@@ -108,12 +108,12 @@
   friend class IteratorImpl;
 
   template <typename Table>
-  void RegisterDbTable(const Table& table) {
-    engine_.RegisterTable(table, Table::Name());
+  void RegisterStaticTable(const Table& table) {
+    engine_.RegisterStaticTable(table, Table::Name());
   }
 
-  void RegisterTableFunction(std::unique_ptr<TableFunction> fn) {
-    engine_.RegisterTableFunction(std::move(fn));
+  void RegisterStaticTableFunction(std::unique_ptr<StaticTableFunction> fn) {
+    engine_.RegisterStaticTableFunction(std::move(fn));
   }
 
   template <typename View>