Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions benchmarks/sql_benchmarks/sort_tpch/benchmarks/q01.benchmark
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 benchmarks/sql_benchmarks/sort_tpch/benchmarks/q02.benchmark
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 benchmarks/sql_benchmarks/sort_tpch/benchmarks/q03.benchmark
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 benchmarks/sql_benchmarks/sort_tpch/benchmarks/q04.benchmark
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 benchmarks/sql_benchmarks/sort_tpch/benchmarks/q05.benchmark
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| }

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

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 (LIMIT makes 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 / respects LIMIT.

Copy link
Copy Markdown
Contributor Author

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


result sql_benchmarks/sort_tpch/results/sf${BENCH_SIZE:-1}/q05.csv
44 changes: 44 additions & 0 deletions benchmarks/sql_benchmarks/sort_tpch/benchmarks/q06.benchmark
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 benchmarks/sql_benchmarks/sort_tpch/benchmarks/q07.benchmark
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 benchmarks/sql_benchmarks/sort_tpch/benchmarks/q08.benchmark
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
Loading
Loading