From 801df5fb254ef0130aef5202313165f966398bdc Mon Sep 17 00:00:00 2001 From: Lin Ma Date: Wed, 25 Apr 2018 08:58:54 -0400 Subject: [PATCH] Delete the unsed index_predicate_ in index scan plans. (#1324) * Delete the unsed index_predicate_ in index scan plans. * Fix a compilation issue. * Move arguments to different lines. --- src/include/planner/hybrid_scan_plan.h | 6 ------ src/include/planner/index_scan_plan.h | 12 +----------- src/planner/hybrid_scan_plan.cpp | 3 +-- src/planner/index_scan_plan.cpp | 7 ++----- 4 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/include/planner/hybrid_scan_plan.h b/src/include/planner/hybrid_scan_plan.h index d232ddd1cce..9854df936d2 100644 --- a/src/include/planner/hybrid_scan_plan.h +++ b/src/include/planner/hybrid_scan_plan.h @@ -54,10 +54,6 @@ class HybridScanPlan : public AbstractScan { return expr_types_; } - const index::IndexScanPredicate &GetIndexPredicate() const { - return index_predicate_; - } - const std::vector &GetValues() const { return values_; } const std::vector &GetRunTimeKeys() const { @@ -81,8 +77,6 @@ class HybridScanPlan : public AbstractScan { oid_t index_id_; - index::IndexScanPredicate index_predicate_; - private: DISALLOW_COPY_AND_MOVE(HybridScanPlan); }; diff --git a/src/include/planner/index_scan_plan.h b/src/include/planner/index_scan_plan.h index 436a1f891c0..77c7b99074b 100644 --- a/src/include/planner/index_scan_plan.h +++ b/src/include/planner/index_scan_plan.h @@ -16,11 +16,11 @@ #include #include +#include "common/internal_types.h" #include "expression/abstract_expression.h" #include "index/scan_optimizer.h" #include "planner/abstract_scan_plan.h" #include "storage/tuple.h" -#include "common/internal_types.h" namespace peloton { @@ -123,10 +123,6 @@ class IndexScanPlan : public AbstractScan { return expr_types_; } - const index::IndexScanPredicate &GetIndexPredicate() const { - return index_predicate_; - } - const std::vector &GetValues() const { return values_; } const std::vector &GetRunTimeKeys() const { @@ -204,12 +200,6 @@ class IndexScanPlan : public AbstractScan { const std::vector runtime_keys_; - // Currently we just support single conjunction predicate - // - // In the future this might be extended into an array of conjunctive - // predicates connected by disjunction - index::IndexScanPredicate index_predicate_; - // whether the index scan range is left open bool left_open_ = false; diff --git a/src/planner/hybrid_scan_plan.cpp b/src/planner/hybrid_scan_plan.cpp index 29ed7b4b919..fb480f7feb4 100644 --- a/src/planner/hybrid_scan_plan.cpp +++ b/src/planner/hybrid_scan_plan.cpp @@ -32,8 +32,7 @@ HybridScanPlan::HybridScanPlan( expr_types_(std::move(index_scan_desc.expr_list)), values_(std::move(index_scan_desc.value_list)), runtime_keys_(std::move(index_scan_desc.runtime_key_list)), - index_id_(index_scan_desc.index_id), - index_predicate_() {} + index_id_(index_scan_desc.index_id) {} } // namespace planner } // namespace peloton diff --git a/src/planner/index_scan_plan.cpp b/src/planner/index_scan_plan.cpp index e32e9abde96..55bca58eb42 100644 --- a/src/planner/index_scan_plan.cpp +++ b/src/planner/index_scan_plan.cpp @@ -11,10 +11,10 @@ //===----------------------------------------------------------------------===// #include "planner/index_scan_plan.h" +#include "common/internal_types.h" #include "expression/constant_value_expression.h" #include "expression/expression_util.h" #include "storage/data_table.h" -#include "common/internal_types.h" namespace peloton { namespace planner { @@ -29,10 +29,7 @@ IndexScanPlan::IndexScanPlan(storage::DataTable *table, key_column_ids_(std::move(index_scan_desc.tuple_column_id_list)), expr_types_(std::move(index_scan_desc.expr_list)), values_with_params_(std::move(index_scan_desc.value_list)), - runtime_keys_(std::move(index_scan_desc.runtime_key_list)), - // Initialize the index scan predicate object and initialize all - // keys that we could initialize - index_predicate_() { + runtime_keys_(std::move(index_scan_desc.runtime_key_list)) { LOG_TRACE("Creating an Index Scan Plan"); if (for_update_flag == true) {