-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add sort tpch SQL benchmark #22814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add sort tpch SQL benchmark #22814
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
benchmarks/sql_benchmarks/sort_tpch/benchmarks/q01.benchmark
This file contains hidden or 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,44 @@ | ||
| echo Loading tpch items sorted: ${BENCH_SORTED:-false} | ||
|
|
||
| # | ||
| # Sort queries with different characteristics: | ||
| # - Sort key with fixed length or variable length (VARCHAR) | ||
| # - Sort key with different cardinality | ||
| # - Different number of sort keys | ||
| # - Different number of payload columns (thin: 1 additional column other | ||
| # than sort keys; wide: all columns except sort keys) | ||
| # | ||
| # DataSet is `lineitem` table in TPCH dataset (16 columns, 6M rows for | ||
| # scale factor 1.0, cardinality is counted from SF1 dataset) | ||
| # | ||
| # Key Columns: | ||
| # - Column `l_linenumber`, type: `INTEGER`, cardinality: 7 | ||
| # - Column `l_suppkey`, type: `BIGINT`, cardinality: 10k | ||
| # - Column `l_orderkey`, type: `BIGINT`, cardinality: 1.5M | ||
| # - Column `l_comment`, type: `VARCHAR`, cardinality: 4.5M (len is ~26 chars) | ||
| # | ||
| # Payload Columns: | ||
| # - Thin variant: `l_partkey` column with `BIGINT` type (1 column) | ||
| # - Wide variant: all columns except for possible key columns (12 columns) | ||
|
|
||
| name Q01 | ||
| group sort_tpch | ||
| subgroup sf${BENCH_SIZE:-1} | ||
|
|
||
| echo Loading sort_tpch sf ${BENCH_SIZE:-1} data | ||
|
|
||
| load sql_benchmarks/sort_tpch/init/load.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from lineitem; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| -- Q1: 1 sort key (type: INTEGER, cardinality: 7) + 1 payload column | ||
| SELECT l_linenumber, l_partkey | ||
| FROM lineitem | ||
| ORDER BY l_linenumber | ||
| ${LIMIT:-false|LIMIT 100| } | ||
|
|
||
| result sql_benchmarks/sort_tpch/results/sf${BENCH_SIZE:-1}/q01.csv |
44 changes: 44 additions & 0 deletions
44
benchmarks/sql_benchmarks/sort_tpch/benchmarks/q02.benchmark
This file contains hidden or 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,44 @@ | ||
| echo Loading tpch items sorted: ${BENCH_SORTED:-false} | ||
|
|
||
| # | ||
| # Sort queries with different characteristics: | ||
| # - Sort key with fixed length or variable length (VARCHAR) | ||
| # - Sort key with different cardinality | ||
| # - Different number of sort keys | ||
| # - Different number of payload columns (thin: 1 additional column other | ||
| # than sort keys; wide: all columns except sort keys) | ||
| # | ||
| # DataSet is `lineitem` table in TPCH dataset (16 columns, 6M rows for | ||
| # scale factor 1.0, cardinality is counted from SF1 dataset) | ||
| # | ||
| # Key Columns: | ||
| # - Column `l_linenumber`, type: `INTEGER`, cardinality: 7 | ||
| # - Column `l_suppkey`, type: `BIGINT`, cardinality: 10k | ||
| # - Column `l_orderkey`, type: `BIGINT`, cardinality: 1.5M | ||
| # - Column `l_comment`, type: `VARCHAR`, cardinality: 4.5M (len is ~26 chars) | ||
| # | ||
| # Payload Columns: | ||
| # - Thin variant: `l_partkey` column with `BIGINT` type (1 column) | ||
| # - Wide variant: all columns except for possible key columns (12 columns) | ||
|
|
||
| name Q02 | ||
| group sort_tpch | ||
| subgroup sf${BENCH_SIZE:-1} | ||
|
|
||
| echo Loading sort_tpch sf ${BENCH_SIZE:-1} data | ||
|
|
||
| load sql_benchmarks/sort_tpch/init/load.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from lineitem; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| -- Q2: 1 sort key (type: BIGINT, cardinality: 1.5M) + 1 payload column | ||
| SELECT l_orderkey, l_partkey | ||
| FROM lineitem | ||
| ORDER BY l_orderkey | ||
| ${LIMIT:-false|LIMIT 100| } | ||
|
|
||
| result sql_benchmarks/sort_tpch/results/sf${BENCH_SIZE:-1}/q02.csv |
44 changes: 44 additions & 0 deletions
44
benchmarks/sql_benchmarks/sort_tpch/benchmarks/q03.benchmark
This file contains hidden or 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,44 @@ | ||
| echo Loading tpch items sorted: ${BENCH_SORTED:-false} | ||
|
|
||
| # | ||
| # Sort queries with different characteristics: | ||
| # - Sort key with fixed length or variable length (VARCHAR) | ||
| # - Sort key with different cardinality | ||
| # - Different number of sort keys | ||
| # - Different number of payload columns (thin: 1 additional column other | ||
| # than sort keys; wide: all columns except sort keys) | ||
| # | ||
| # DataSet is `lineitem` table in TPCH dataset (16 columns, 6M rows for | ||
| # scale factor 1.0, cardinality is counted from SF1 dataset) | ||
| # | ||
| # Key Columns: | ||
| # - Column `l_linenumber`, type: `INTEGER`, cardinality: 7 | ||
| # - Column `l_suppkey`, type: `BIGINT`, cardinality: 10k | ||
| # - Column `l_orderkey`, type: `BIGINT`, cardinality: 1.5M | ||
| # - Column `l_comment`, type: `VARCHAR`, cardinality: 4.5M (len is ~26 chars) | ||
| # | ||
| # Payload Columns: | ||
| # - Thin variant: `l_partkey` column with `BIGINT` type (1 column) | ||
| # - Wide variant: all columns except for possible key columns (12 columns) | ||
|
|
||
| name Q03 | ||
| group sort_tpch | ||
| subgroup sf${BENCH_SIZE:-1} | ||
|
|
||
| echo Loading sort_tpch sf ${BENCH_SIZE:-1} data | ||
|
|
||
| load sql_benchmarks/sort_tpch/init/load.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from lineitem; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| -- Q3: 1 sort key (type: VARCHAR, cardinality: 4.5M) + 1 payload column | ||
| SELECT l_comment, l_partkey | ||
| FROM lineitem | ||
| ORDER BY l_comment | ||
| ${LIMIT:-false|LIMIT 100| } | ||
|
|
||
| result sql_benchmarks/sort_tpch/results/sf${BENCH_SIZE:-1}/q03.csv |
44 changes: 44 additions & 0 deletions
44
benchmarks/sql_benchmarks/sort_tpch/benchmarks/q04.benchmark
This file contains hidden or 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,44 @@ | ||
| echo Loading tpch items sorted: ${BENCH_SORTED:-false} | ||
|
|
||
| # | ||
| # Sort queries with different characteristics: | ||
| # - Sort key with fixed length or variable length (VARCHAR) | ||
| # - Sort key with different cardinality | ||
| # - Different number of sort keys | ||
| # - Different number of payload columns (thin: 1 additional column other | ||
| # than sort keys; wide: all columns except sort keys) | ||
| # | ||
| # DataSet is `lineitem` table in TPCH dataset (16 columns, 6M rows for | ||
| # scale factor 1.0, cardinality is counted from SF1 dataset) | ||
| # | ||
| # Key Columns: | ||
| # - Column `l_linenumber`, type: `INTEGER`, cardinality: 7 | ||
| # - Column `l_suppkey`, type: `BIGINT`, cardinality: 10k | ||
| # - Column `l_orderkey`, type: `BIGINT`, cardinality: 1.5M | ||
| # - Column `l_comment`, type: `VARCHAR`, cardinality: 4.5M (len is ~26 chars) | ||
| # | ||
| # Payload Columns: | ||
| # - Thin variant: `l_partkey` column with `BIGINT` type (1 column) | ||
| # - Wide variant: all columns except for possible key columns (12 columns) | ||
|
|
||
| name Q04 | ||
| group sort_tpch | ||
| subgroup sf${BENCH_SIZE:-1} | ||
|
|
||
| echo Loading sort_tpch sf ${BENCH_SIZE:-1} data | ||
|
|
||
| load sql_benchmarks/sort_tpch/init/load.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from lineitem; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| -- Q4: 2 sort keys {(BIGINT, 1.5M), (INTEGER, 7)} + 1 payload column | ||
| SELECT l_orderkey, l_linenumber, l_partkey | ||
| FROM lineitem | ||
| ORDER BY l_orderkey, l_linenumber | ||
| ${LIMIT:-false|LIMIT 100| } | ||
|
|
||
| result sql_benchmarks/sort_tpch/results/sf${BENCH_SIZE:-1}/q04.csv |
44 changes: 44 additions & 0 deletions
44
benchmarks/sql_benchmarks/sort_tpch/benchmarks/q05.benchmark
This file contains hidden or 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,44 @@ | ||
| echo Loading tpch items sorted: ${BENCH_SORTED:-false} | ||
|
|
||
| # | ||
| # Sort queries with different characteristics: | ||
| # - Sort key with fixed length or variable length (VARCHAR) | ||
| # - Sort key with different cardinality | ||
| # - Different number of sort keys | ||
| # - Different number of payload columns (thin: 1 additional column other | ||
| # than sort keys; wide: all columns except sort keys) | ||
| # | ||
| # DataSet is `lineitem` table in TPCH dataset (16 columns, 6M rows for | ||
| # scale factor 1.0, cardinality is counted from SF1 dataset) | ||
| # | ||
| # Key Columns: | ||
| # - Column `l_linenumber`, type: `INTEGER`, cardinality: 7 | ||
| # - Column `l_suppkey`, type: `BIGINT`, cardinality: 10k | ||
| # - Column `l_orderkey`, type: `BIGINT`, cardinality: 1.5M | ||
| # - Column `l_comment`, type: `VARCHAR`, cardinality: 4.5M (len is ~26 chars) | ||
| # | ||
| # Payload Columns: | ||
| # - Thin variant: `l_partkey` column with `BIGINT` type (1 column) | ||
| # - Wide variant: all columns except for possible key columns (12 columns) | ||
|
|
||
| name Q05 | ||
| group sort_tpch | ||
| subgroup sf${BENCH_SIZE:-1} | ||
|
|
||
| echo Loading sort_tpch sf ${BENCH_SIZE:-1} data | ||
|
|
||
| load sql_benchmarks/sort_tpch/init/load.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from lineitem; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| -- Q5: 3 sort keys {(INTEGER, 7), (BIGINT, 10k), (BIGINT, 1.5M)} + no payload column | ||
| SELECT l_linenumber, l_suppkey, l_orderkey | ||
| FROM lineitem | ||
| ORDER BY l_linenumber, l_suppkey, l_orderkey | ||
| ${LIMIT:-false|LIMIT 100| } | ||
|
|
||
| result sql_benchmarks/sort_tpch/results/sf${BENCH_SIZE:-1}/q05.csv | ||
44 changes: 44 additions & 0 deletions
44
benchmarks/sql_benchmarks/sort_tpch/benchmarks/q06.benchmark
This file contains hidden or 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,44 @@ | ||
| echo Loading tpch items sorted: ${BENCH_SORTED:-false} | ||
|
|
||
| # | ||
| # Sort queries with different characteristics: | ||
| # - Sort key with fixed length or variable length (VARCHAR) | ||
| # - Sort key with different cardinality | ||
| # - Different number of sort keys | ||
| # - Different number of payload columns (thin: 1 additional column other | ||
| # than sort keys; wide: all columns except sort keys) | ||
| # | ||
| # DataSet is `lineitem` table in TPCH dataset (16 columns, 6M rows for | ||
| # scale factor 1.0, cardinality is counted from SF1 dataset) | ||
| # | ||
| # Key Columns: | ||
| # - Column `l_linenumber`, type: `INTEGER`, cardinality: 7 | ||
| # - Column `l_suppkey`, type: `BIGINT`, cardinality: 10k | ||
| # - Column `l_orderkey`, type: `BIGINT`, cardinality: 1.5M | ||
| # - Column `l_comment`, type: `VARCHAR`, cardinality: 4.5M (len is ~26 chars) | ||
| # | ||
| # Payload Columns: | ||
| # - Thin variant: `l_partkey` column with `BIGINT` type (1 column) | ||
| # - Wide variant: all columns except for possible key columns (12 columns) | ||
|
|
||
| name Q06 | ||
| group sort_tpch | ||
| subgroup sf${BENCH_SIZE:-1} | ||
|
|
||
| echo Loading sort_tpch sf ${BENCH_SIZE:-1} data | ||
|
|
||
| load sql_benchmarks/sort_tpch/init/load.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from lineitem; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| -- Q6: 3 sort keys {(INTEGER, 7), (BIGINT, 10k), (BIGINT, 1.5M)} + 1 payload column | ||
| SELECT l_linenumber, l_suppkey, l_orderkey, l_partkey | ||
| FROM lineitem | ||
| ORDER BY l_linenumber, l_suppkey, l_orderkey | ||
| ${LIMIT:-false|LIMIT 100| } | ||
|
|
||
| result sql_benchmarks/sort_tpch/results/sf${BENCH_SIZE:-1}/q06.csv |
58 changes: 58 additions & 0 deletions
58
benchmarks/sql_benchmarks/sort_tpch/benchmarks/q07.benchmark
This file contains hidden or 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,58 @@ | ||
| echo Loading tpch items sorted: ${BENCH_SORTED:-false} | ||
|
|
||
| # | ||
| # Sort queries with different characteristics: | ||
| # - Sort key with fixed length or variable length (VARCHAR) | ||
| # - Sort key with different cardinality | ||
| # - Different number of sort keys | ||
| # - Different number of payload columns (thin: 1 additional column other | ||
| # than sort keys; wide: all columns except sort keys) | ||
| # | ||
| # DataSet is `lineitem` table in TPCH dataset (16 columns, 6M rows for | ||
| # scale factor 1.0, cardinality is counted from SF1 dataset) | ||
| # | ||
| # Key Columns: | ||
| # - Column `l_linenumber`, type: `INTEGER`, cardinality: 7 | ||
| # - Column `l_suppkey`, type: `BIGINT`, cardinality: 10k | ||
| # - Column `l_orderkey`, type: `BIGINT`, cardinality: 1.5M | ||
| # - Column `l_comment`, type: `VARCHAR`, cardinality: 4.5M (len is ~26 chars) | ||
| # | ||
| # Payload Columns: | ||
| # - Thin variant: `l_partkey` column with `BIGINT` type (1 column) | ||
| # - Wide variant: all columns except for possible key columns (12 columns) | ||
|
|
||
| name Q07 | ||
| group sort_tpch | ||
| subgroup sf${BENCH_SIZE:-1} | ||
|
|
||
| echo Loading sort_tpch sf ${BENCH_SIZE:-1} data | ||
|
|
||
| load sql_benchmarks/sort_tpch/init/load.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from lineitem; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| -- Q7: 3 sort keys {(INTEGER, 7), (BIGINT, 10k), (BIGINT, 1.5M)} + 12 all other columns | ||
| SELECT l_linenumber, | ||
| l_suppkey, | ||
| l_orderkey, | ||
| l_partkey, | ||
| l_quantity, | ||
| l_extendedprice, | ||
| l_discount, | ||
| l_tax, | ||
| l_returnflag, | ||
| l_linestatus, | ||
| l_shipdate, | ||
| l_commitdate, | ||
| l_receiptdate, | ||
| l_shipinstruct, | ||
| l_shipmode | ||
| FROM lineitem | ||
| ORDER BY l_linenumber, l_suppkey, l_orderkey | ||
| ${LIMIT:-false|LIMIT 100| } | ||
|
|
||
| result sql_benchmarks/sort_tpch/results/sf${BENCH_SIZE:-1}/q07.csv |
44 changes: 44 additions & 0 deletions
44
benchmarks/sql_benchmarks/sort_tpch/benchmarks/q08.benchmark
This file contains hidden or 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,44 @@ | ||
| echo Loading tpch items sorted: ${BENCH_SORTED:-false} | ||
|
|
||
| # | ||
| # Sort queries with different characteristics: | ||
| # - Sort key with fixed length or variable length (VARCHAR) | ||
| # - Sort key with different cardinality | ||
| # - Different number of sort keys | ||
| # - Different number of payload columns (thin: 1 additional column other | ||
| # than sort keys; wide: all columns except sort keys) | ||
| # | ||
| # DataSet is `lineitem` table in TPCH dataset (16 columns, 6M rows for | ||
| # scale factor 1.0, cardinality is counted from SF1 dataset) | ||
| # | ||
| # Key Columns: | ||
| # - Column `l_linenumber`, type: `INTEGER`, cardinality: 7 | ||
| # - Column `l_suppkey`, type: `BIGINT`, cardinality: 10k | ||
| # - Column `l_orderkey`, type: `BIGINT`, cardinality: 1.5M | ||
| # - Column `l_comment`, type: `VARCHAR`, cardinality: 4.5M (len is ~26 chars) | ||
| # | ||
| # Payload Columns: | ||
| # - Thin variant: `l_partkey` column with `BIGINT` type (1 column) | ||
| # - Wide variant: all columns except for possible key columns (12 columns) | ||
|
|
||
| name Q08 | ||
| group sort_tpch | ||
| subgroup sf${BENCH_SIZE:-1} | ||
|
|
||
| echo Loading sort_tpch sf ${BENCH_SIZE:-1} data | ||
|
|
||
| load sql_benchmarks/sort_tpch/init/load.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from lineitem; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| -- Q8: 4 sort keys {(BIGINT, 1.5M), (BIGINT, 10k), (INTEGER, 7), (VARCHAR, 4.5M)} + no payload column | ||
| SELECT l_orderkey, l_suppkey, l_linenumber, l_comment | ||
| FROM lineitem | ||
| ORDER BY l_orderkey, l_suppkey, l_linenumber, l_comment | ||
| ${LIMIT:-false|LIMIT 100| } | ||
|
|
||
| result sql_benchmarks/sort_tpch/results/sf${BENCH_SIZE:-1}/q08.csv |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to document these env vars?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they're documented in the sql_benchmarks/README.md but I'd have to check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some that are shared (
LIMITmakes sense as shared) and some that are per benchmark. I have seen them documented, but I'm not sure if we're documenting which global ones apply to which benchmarks (i.e. what options each bench supports). As in: without looking at the actual benchmark code I wouldn't know that this benchmark accepts / respectsLIMIT.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This likely should be addressed as part of #21935