Skip to content

Commit 8b9b2fc

Browse files
authored
fix: add missing row count limits to TPC-H queries (#16230)
For queries 2,3,10,18 and 21 the TPC-H spec defines a row count limit. ``` 2.1.2.9 Queries 2, 3, 10, 18 and 21 require that a given number of rows are to be returned (e.g., “Return the first 10 selected rows”). If N is the number of rows to be returned, the query must return exactly the first N rows unless fewer than N rows qualify, in which case all rows must be returned. There are three permissible ways of satisfying this requirement. A test sponsor must select any one of them and use it consistently for all the queries that require that a specified number of rows be returned. ``` https://www.tpc.org/tpc_documents_current_versions/pdf/tpc-h_v2.17.1.pdf
1 parent 6f1ca29 commit 8b9b2fc

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

benchmarks/queries/q10.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ group by
2828
c_address,
2929
c_comment
3030
order by
31-
revenue desc;
31+
revenue desc
32+
limit 20;

benchmarks/queries/q18.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ group by
2929
o_totalprice
3030
order by
3131
o_totalprice desc,
32-
o_orderdate;
32+
o_orderdate
33+
limit 100;

benchmarks/queries/q2.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ order by
4040
s_acctbal desc,
4141
n_name,
4242
s_name,
43-
p_partkey;
43+
p_partkey
44+
limit 100;

benchmarks/queries/q21.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ group by
3636
s_name
3737
order by
3838
numwait desc,
39-
s_name;
39+
s_name
40+
limit 100;

benchmarks/queries/q3.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ group by
1919
o_shippriority
2020
order by
2121
revenue desc,
22-
o_orderdate;
22+
o_orderdate
23+
limit 10;

0 commit comments

Comments
 (0)