From 7d00c4eac01e43b7f115b5f6792b56dc8ad120c8 Mon Sep 17 00:00:00 2001 From: Teon Banek Date: Fri, 16 Jun 2017 09:22:30 +0200 Subject: [PATCH] Add query_cost_planner gflag Reviewers: mislav.bradac, buda, florijan Reviewed By: buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D479 --- src/query/interpreter.cpp | 3 +++ src/query/interpreter.hpp | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/query/interpreter.cpp b/src/query/interpreter.cpp index 15065f3c3..5be604d14 100644 --- a/src/query/interpreter.cpp +++ b/src/query/interpreter.cpp @@ -4,3 +4,6 @@ // false, this is useful for recerating antlr crashes in highly concurrent test. // Once antlr bugs are fixed, or real test is written this flag can be removed. DEFINE_bool(ast_cache, true, "Use ast caching."); + +DEFINE_bool(query_cost_planner, true, + "Use the cost estimator to generate plans for queries."); diff --git a/src/query/interpreter.hpp b/src/query/interpreter.hpp index 98f19f956..0d4cbdb80 100644 --- a/src/query/interpreter.hpp +++ b/src/query/interpreter.hpp @@ -14,8 +14,9 @@ #include "query/plan/cost_estimator.hpp" #include "query/plan/planner.hpp" -// TODO: Remove this flag and add flag that limits cache size. +// TODO: Remove ast_cache flag and add flag that limits cache size. DECLARE_bool(ast_cache); +DECLARE_bool(query_cost_planner); namespace query { @@ -77,8 +78,6 @@ class Interpreter : public Loggable { // high level tree -> logical plan std::unique_ptr logical_plan; double query_plan_cost_estimation = 0.0; - // TODO: Use gflags - bool FLAGS_query_cost_planner = true; if (FLAGS_query_cost_planner) { auto plans = plan::MakeLogicalPlan( ast_storage, symbol_table, &db_accessor);