Created
April 1, 2020 15:40
-
-
Save XPerianer/47faa74e7933566eb73148d1468f43d3 to your computer and use it in GitHub Desktop.
Performance of PosList pointing into index
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BENCHMARK_F(TPCHDataMicroBenchmarkFixture, BM_TPCHQ6IndexScan)(benchmark::State& state) { | |
auto& sm = Hyrise::get().storage_manager; | |
auto lineitem_table = sm.get_table("lineitem"); | |
std::vector<ColumnID> index_column_ids = {ColumnID{10}}; | |
lineitem_table->create_index<GroupKeyIndex>(index_column_ids); | |
// Similar to the less predicate used in tpchq6 on l_shipdate. | |
const std::vector<ColumnID> left_column_ids = {ColumnID{10}}; | |
const std::vector<AllTypeVariant> right_values = {"1995-01-01"}; | |
for (auto _ : state) { | |
const auto table_scan = std::make_shared<IndexScan>(_table_wrapper_map.at("lineitem"), SegmentIndexType::GroupKey, | |
left_column_ids, PredicateCondition::LessThan, right_values); | |
table_scan->execute(); | |
} | |
} | |
BENCHMARK_F(TPCHDataMicroBenchmarkFixture, BM_TPCHQ6IndexScan_Matches_All_Predicate)(benchmark::State& state) { | |
auto& sm = Hyrise::get().storage_manager; | |
auto lineitem_table = sm.get_table("lineitem"); | |
std::vector<ColumnID> index_column_ids = {ColumnID{10}}; | |
lineitem_table->create_index<GroupKeyIndex>(index_column_ids); | |
const std::vector<ColumnID> left_column_ids = {ColumnID{10}}; | |
const std::vector<AllTypeVariant> right_values = {"1600-01-01"}; | |
for (auto _ : state) { | |
const auto table_scan = std::make_shared<IndexScan>(_table_wrapper_map.at("lineitem"), SegmentIndexType::GroupKey, | |
left_column_ids, PredicateCondition::GreaterThan, right_values); | |
table_scan->execute(); | |
} | |
} | |
BENCHMARK_F(TPCHDataMicroBenchmarkFixture, BM_TPCHQ6TableScan_After_IndexScan)(benchmark::State& state) { | |
auto& sm = Hyrise::get().storage_manager; | |
auto lineitem_table = sm.get_table("lineitem"); | |
std::vector<ColumnID> index_column_ids = {ColumnID{10}}; | |
lineitem_table->create_index<GroupKeyIndex>(index_column_ids); | |
const std::vector<ColumnID> left_column_ids = {ColumnID{10}}; | |
const std::vector<AllTypeVariant> right_values = {"1995-01-01"}; | |
const auto index_scan = std::make_shared<IndexScan>(_table_wrapper_map.at("lineitem"), SegmentIndexType::GroupKey, | |
left_column_ids, PredicateCondition::LessThan, right_values); | |
index_scan->execute(); | |
const auto scan_result = index_scan->get_output(); | |
for (auto _ : state) { | |
const auto table_scan = std::make_shared<TableScan>(index_scan, _tpchq6_quantity_predicate); | |
table_scan->execute(); | |
} | |
} | |
BENCHMARK_F(TPCHDataMicroBenchmarkFixture, BM_TPCHQ6IndexScan_And_TableScan_Together)(benchmark::State& state) { | |
auto& sm = Hyrise::get().storage_manager; | |
auto lineitem_table = sm.get_table("lineitem"); | |
std::vector<ColumnID> index_column_ids = {ColumnID{10}}; | |
lineitem_table->create_index<GroupKeyIndex>(index_column_ids); | |
const std::vector<ColumnID> left_column_ids = {ColumnID{10}}; | |
const std::vector<AllTypeVariant> right_values = {"1995-01-01"}; | |
for (auto _ : state) { | |
const auto index_scan = std::make_shared<IndexScan>(_table_wrapper_map.at("lineitem"), SegmentIndexType::GroupKey, | |
left_column_ids, PredicateCondition::LessThan, right_values); | |
index_scan->execute(); | |
const auto table_scan = std::make_shared<TableScan>(index_scan, _tpchq6_quantity_predicate); | |
table_scan->execute(); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PosList pointing into index: | |
------------------------------------------------------------------------------------------------------------------ | |
Benchmark Time CPU Iterations | |
------------------------------------------------------------------------------------------------------------------ | |
TPCHDataMicroBenchmarkFixture/BM_TPCHQ6IndexScan 182104 ns 182102 ns 3837 | |
TPCHDataMicroBenchmarkFixture/BM_TPCHQ6IndexScan_Matches_All_Predicate 328445 ns 328420 ns 2147 | |
TPCHDataMicroBenchmarkFixture/BM_TPCHQ6TableScan_After_IndexScan 22750846 ns 22750434 ns 28 | |
TPCHDataMicroBenchmarkFixture/BM_TPCHQ6IndexScan_And_TableScan_Together 23127492 ns 23124115 ns 30 | |
normal (RowID) posList: | |
------------------------------------------------------------------------------------------------------------------ | |
Benchmark Time CPU Iterations | |
------------------------------------------------------------------------------------------------------------------ | |
TPCHDataMicroBenchmarkFixture/BM_TPCHQ6IndexScan 4177652 ns 4177585 ns 166 | |
TPCHDataMicroBenchmarkFixture/BM_TPCHQ6IndexScan_Matches_All_Predicate 11711713 ns 11711153 ns 58 | |
TPCHDataMicroBenchmarkFixture/BM_TPCHQ6TableScan_After_IndexScan 20667343 ns 20666796 ns 34 | |
TPCHDataMicroBenchmarkFixture/BM_TPCHQ6IndexScan_And_TableScan_Together 25021510 ns 25019400 ns 28 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am getting these results for your branch but it is kind of pointless without being able to comparing it to the normal (RowID) PosList.