-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into vectortypes
- Loading branch information
Showing
106 changed files
with
32,847 additions
and
13,987 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
include_directories(../../third_party/dbgen/include) | ||
include_directories(../../third_party/sqlite/include) | ||
add_library(duckdb_benchmark_expression_reordering OBJECT | ||
benchmark_expressions.cpp) | ||
benchmark_expressions.cpp | ||
adaptive_reordering.cpp) | ||
set(BENCHMARK_OBJECT_FILES ${BENCHMARK_OBJECT_FILES} | ||
$<TARGET_OBJECTS:duckdb_benchmark_expression_reordering> PARENT_SCOPE) |
128 changes: 128 additions & 0 deletions
128
benchmark/expression_reordering/adaptive_reordering.cpp
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
#include "benchmark_runner.hpp" | ||
#include "compare_result.hpp" | ||
#include "dbgen.hpp" | ||
#include "duckdb_benchmark_macro.hpp" | ||
|
||
using namespace duckdb; | ||
using namespace std; | ||
|
||
#define SF 1 | ||
|
||
DUCKDB_BENCHMARK(AdaptiveStringReorderingAND, "[expression_reordering]") | ||
void Load(DuckDBBenchmarkState *state) override { | ||
// load the data into the tpch schema | ||
tpch::dbgen(SF, state->db); | ||
} | ||
string GetQuery() override { | ||
return "SELECT * FROM lineitem WHERE l_comment LIKE '%' AND l_comment LIKE '%s%' AND l_comment LIKE '%str%';"; | ||
} | ||
string VerifyResult(QueryResult *result) override { | ||
if (!result->success) { | ||
return result->error; | ||
} | ||
return string(); | ||
} | ||
string BenchmarkInfo() override { | ||
return "Execute adaptive reordering query ..."; | ||
} | ||
FINISH_BENCHMARK(AdaptiveStringReorderingAND) | ||
|
||
|
||
DUCKDB_BENCHMARK(AdaptiveStringReorderingOR, "[expression_reordering]") | ||
void Load(DuckDBBenchmarkState *state) override { | ||
// load the data into the tpch schema | ||
tpch::dbgen(SF, state->db); | ||
} | ||
string GetQuery() override { | ||
return "SELECT * FROM lineitem WHERE l_comment LIKE '%' OR l_comment LIKE '%s%' OR l_comment LIKE '%str%';"; | ||
} | ||
string VerifyResult(QueryResult *result) override { | ||
if (!result->success) { | ||
return result->error; | ||
} | ||
return string(); | ||
} | ||
string BenchmarkInfo() override { | ||
return "Execute adaptive reordering query ..."; | ||
} | ||
FINISH_BENCHMARK(AdaptiveStringReorderingOR) | ||
|
||
|
||
DUCKDB_BENCHMARK(AdaptiveNumericReorderingAND, "[expression_reordering]") | ||
void Load(DuckDBBenchmarkState *state) override { | ||
// load the data into the tpch schema | ||
tpch::dbgen(SF, state->db); | ||
} | ||
string GetQuery() override { | ||
return "SELECT * FROM lineitem WHERE l_quantity < 11 AND l_shipdate < 727272 AND l_receiptdate < 828282 AND l_tax < 0.05;"; | ||
} | ||
string VerifyResult(QueryResult *result) override { | ||
if (!result->success) { | ||
return result->error; | ||
} | ||
return string(); | ||
} | ||
string BenchmarkInfo() override { | ||
return "Execute adaptive reordering query ..."; | ||
} | ||
FINISH_BENCHMARK(AdaptiveNumericReorderingAND) | ||
|
||
|
||
DUCKDB_BENCHMARK(AdaptiveNumericReorderingOR, "[expression_reordering]") | ||
void Load(DuckDBBenchmarkState *state) override { | ||
// load the data into the tpch schema | ||
tpch::dbgen(SF, state->db); | ||
} | ||
string GetQuery() override { | ||
return "SELECT * FROM lineitem WHERE l_quantity < 11 OR l_shipdate < 727272 OR l_receiptdate < 828282 OR l_tax < 0.05;"; | ||
} | ||
string VerifyResult(QueryResult *result) override { | ||
if (!result->success) { | ||
return result->error; | ||
} | ||
return string(); | ||
} | ||
string BenchmarkInfo() override { | ||
return "Execute adaptive reordering query ..."; | ||
} | ||
FINISH_BENCHMARK(AdaptiveNumericReorderingOR) | ||
|
||
|
||
DUCKDB_BENCHMARK(AdaptiveMixedReorderingAND, "[expression_reordering]") | ||
void Load(DuckDBBenchmarkState *state) override { | ||
// load the data into the tpch schema | ||
tpch::dbgen(SF, state->db); | ||
} | ||
string GetQuery() override { | ||
return "SELECT * FROM lineitem WHERE l_returnflag = 'R' AND l_orderkey > 5000 AND l_shipdate > 5;"; | ||
} | ||
string VerifyResult(QueryResult *result) override { | ||
if (!result->success) { | ||
return result->error; | ||
} | ||
return string(); | ||
} | ||
string BenchmarkInfo() override { | ||
return "Execute adaptive reordering query ..."; | ||
} | ||
FINISH_BENCHMARK(AdaptiveMixedReorderingAND) | ||
|
||
|
||
DUCKDB_BENCHMARK(AdaptiveMixedReorderingOR, "[expression_reordering]") | ||
void Load(DuckDBBenchmarkState *state) override { | ||
// load the data into the tpch schema | ||
tpch::dbgen(SF, state->db); | ||
} | ||
string GetQuery() override { | ||
return "SELECT * FROM lineitem WHERE l_returnflag = 'R' OR l_orderkey > 5000 OR l_shipdate > 5;"; | ||
} | ||
string VerifyResult(QueryResult *result) override { | ||
if (!result->success) { | ||
return result->error; | ||
} | ||
return string(); | ||
} | ||
string BenchmarkInfo() override { | ||
return "Execute adaptive reordering query ..."; | ||
} | ||
FINISH_BENCHMARK(AdaptiveMixedReorderingOR) |
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
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
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
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
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
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
Oops, something went wrong.