Extract QueryVisitor from HierarchicalTreeVisitor

Summary:
This change makes HierarchicalTreeVisitor visit only Cypher related AST
nodes. QueryVisitor can be used to differentiate between various query
types we have. The next step is to either rename HierarchicalTreeVisitor
to something like CypherQueryVisitor, or perhaps extract Clause visiting
from it.

Reviewers: mtomic, llugovic

Reviewed By: llugovic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1710
This commit is contained in:
Teon Banek
2018-10-30 15:29:12 +01:00
parent bbe095d41a
commit 5df4d55ec1
16 changed files with 260 additions and 318 deletions

View File

@@ -41,9 +41,7 @@ static void BM_PlanChainedMatches(benchmark::State &state) {
query::AstStorage storage;
int num_matches = state.range(0);
auto *query = AddChainedMatches(num_matches, storage);
query::SymbolTable symbol_table;
query::SymbolGenerator symbol_generator(symbol_table);
query->Accept(symbol_generator);
auto symbol_table = query::MakeSymbolTable(query);
auto ctx =
query::plan::MakePlanningContext(storage, symbol_table, query, *dba);
state.ResumeTiming();
@@ -121,9 +119,7 @@ static void BM_PlanAndEstimateIndexedMatching(benchmark::State &state) {
query::AstStorage storage;
auto *query = AddIndexedMatches(index_count, label,
std::make_pair("prop", prop), storage);
query::SymbolTable symbol_table;
query::SymbolGenerator symbol_generator(symbol_table);
query->Accept(symbol_generator);
auto symbol_table = query::MakeSymbolTable(query);
state.ResumeTiming();
auto ctx =
query::plan::MakePlanningContext(storage, symbol_table, query, *dba);
@@ -157,9 +153,7 @@ static void BM_PlanAndEstimateIndexedMatchingWithCachedCounts(
query::AstStorage storage;
auto *query = AddIndexedMatches(index_count, label,
std::make_pair("prop", prop), storage);
query::SymbolTable symbol_table;
query::SymbolGenerator symbol_generator(symbol_table);
query->Accept(symbol_generator);
auto symbol_table = query::MakeSymbolTable(query);
state.ResumeTiming();
auto ctx = query::plan::MakePlanningContext(storage, symbol_table, query,
vertex_counts);