Skip to content

Commit 205480d

Browse files
authored
Fix pg tpc-ds query texts (#1557)
1 parent 2a5a5bd commit 205480d

File tree

8 files changed

+42
-42
lines changed

8 files changed

+42
-42
lines changed

ydb/library/benchmarks/queries/tpcds/pg/q32.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ from
66
,{{item}}
77
,{{date_dim}}
88
where
9-
i_manufact_id = 269
9+
i_manufact_id = 66
1010
and i_item_sk = cs_item_sk
1111
and d_date between '2002-03-29'::date and
1212
(cast('2002-03-29' as date) + interval '90' day)::date

ydb/library/benchmarks/queries/tpcds/pg/q33.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ where i_category in ('Books'))
5555
i_manufact_id
5656
from
5757
{{item}}
58-
where i_category in ('Books'))
58+
where i_category in ('Home'))
5959
and ws_item_sk = i_item_sk
6060
and ws_sold_date_sk = d_date_sk
6161
and d_year = 1998

ydb/library/benchmarks/queries/tpcds/pg/q45.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ select ca_zip, ca_county, sum(ws_sales_price)
1313
)
1414
)
1515
and ws_sold_date_sk = d_date_sk
16-
and d_qoy = 2 and d_year = 1998
16+
and d_qoy = 1 and d_year = 1998
1717
group by ca_zip, ca_county
1818
order by ca_zip, ca_county
1919
limit 100;

ydb/library/benchmarks/queries/tpcds/pg/q46.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ select c_last_name
1717
and store_sales.ss_store_sk = store.s_store_sk
1818
and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
1919
and store_sales.ss_addr_sk = customer_address.ca_address_sk
20-
and (household_demographics.hd_dep_count = 5 or
21-
household_demographics.hd_vehicle_count= 3)
20+
and (household_demographics.hd_dep_count = 0 or
21+
household_demographics.hd_vehicle_count= 1)
2222
and date_dim.d_dow in (6,0)
2323
and date_dim.d_year in (2000,2000+1,2000+2)
2424
and store.s_city in ('Five Forks','Oakland','Fairview','Winchester','Farmington')

ydb/library/benchmarks/queries/tpcds/pg/q59.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ with wss as
2727
from wss,{{store}},{{date_dim}} d
2828
where d.d_week_seq = wss.d_week_seq and
2929
ss_store_sk = s_store_sk and
30-
d_month_seq between 1185 and 1185 + 11) y,
30+
d_month_seq between 1205 and 1205 + 11) y,
3131
(select s_store_name s_store_name2,wss.d_week_seq d_week_seq2
3232
,s_store_id s_store_id2,sun_sales sun_sales2
3333
,mon_sales mon_sales2,tue_sales tue_sales2

ydb/library/benchmarks/queries/tpcds/pg/q66.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ select
194194
and cs_sold_date_sk = d_date_sk
195195
and cs_sold_time_sk = t_time_sk
196196
and cs_ship_mode_sk = sm_ship_mode_sk
197-
and d_year = 2002
198-
and t_time between 49530 AND 49530+28800
197+
and d_year = 2001
198+
and t_time between 9453 AND 9453+28800
199199
and sm_carrier in ('MSC','GERMA')
200200
group by
201201
w_warehouse_name

ydb/library/benchmarks/queries/tpcds/pg/q82.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ select i_item_id
88
and inv_item_sk = i_item_sk
99
and d_date_sk=inv_date_sk
1010
and d_date between cast('2001-01-28' as date) and (cast('2001-01-28' as date) + interval '60' day)::date
11-
and i_manufact_id in (437,129,727,663)
11+
and i_manufact_id in (80,675,292,17)
1212
and inv_quantity_on_hand between 100 and 500
1313
and ss_item_sk = i_item_sk
1414
group by i_item_id,i_item_desc,i_current_price

ydb/library/benchmarks/queries/tpcds/pg/q88.sql

+33-33
Original file line numberDiff line numberDiff line change
@@ -4,69 +4,69 @@ select *
44
from
55
(select count(*) h8_30_to_9
66
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
7-
where ss_sold_time_sk = time_dim.t_time_sk
8-
and ss_hdemo_sk = household_demographics.hd_demo_sk
7+
where ss_sold_time_sk = time_dim.t_time_sk
8+
and ss_hdemo_sk = household_demographics.hd_demo_sk
99
and ss_store_sk = s_store_sk
1010
and time_dim.t_hour = 8
1111
and time_dim.t_minute >= 30
12-
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
13-
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
14-
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
12+
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
13+
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
14+
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
1515
and store.s_store_name = 'ese') s1,
16-
(select count(*) h9_to_9_30
16+
(select count(*) h9_to_9_30
1717
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
1818
where ss_sold_time_sk = time_dim.t_time_sk
1919
and ss_hdemo_sk = household_demographics.hd_demo_sk
20-
and ss_store_sk = s_store_sk
21-
and time_dim.t_hour = 9
20+
and ss_store_sk = s_store_sk
21+
and time_dim.t_hour = 9
2222
and time_dim.t_minute < 30
23-
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
24-
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
25-
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
23+
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
24+
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
25+
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
2626
and store.s_store_name = 'ese') s2,
27-
(select count(*) h9_30_to_10
27+
(select count(*) h9_30_to_10
2828
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
2929
where ss_sold_time_sk = time_dim.t_time_sk
3030
and ss_hdemo_sk = household_demographics.hd_demo_sk
3131
and ss_store_sk = s_store_sk
3232
and time_dim.t_hour = 9
3333
and time_dim.t_minute >= 30
34-
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
35-
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
36-
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
34+
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=3+2) or
35+
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
36+
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
3737
and store.s_store_name = 'ese') s3,
3838
(select count(*) h10_to_10_30
3939
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
4040
where ss_sold_time_sk = time_dim.t_time_sk
4141
and ss_hdemo_sk = household_demographics.hd_demo_sk
4242
and ss_store_sk = s_store_sk
43-
and time_dim.t_hour = 10
43+
and time_dim.t_hour = 10
4444
and time_dim.t_minute < 30
45-
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
46-
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
47-
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
45+
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
46+
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
47+
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
4848
and store.s_store_name = 'ese') s4,
4949
(select count(*) h10_30_to_11
5050
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
5151
where ss_sold_time_sk = time_dim.t_time_sk
5252
and ss_hdemo_sk = household_demographics.hd_demo_sk
5353
and ss_store_sk = s_store_sk
54-
and time_dim.t_hour = 10
54+
and time_dim.t_hour = 10
5555
and time_dim.t_minute >= 30
56-
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
57-
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
58-
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
56+
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
57+
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
58+
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
5959
and store.s_store_name = 'ese') s5,
6060
(select count(*) h11_to_11_30
6161
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
6262
where ss_sold_time_sk = time_dim.t_time_sk
6363
and ss_hdemo_sk = household_demographics.hd_demo_sk
64-
and ss_store_sk = s_store_sk
64+
and ss_store_sk = s_store_sk
6565
and time_dim.t_hour = 11
6666
and time_dim.t_minute < 30
67-
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
68-
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
69-
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
67+
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
68+
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
69+
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
7070
and store.s_store_name = 'ese') s6,
7171
(select count(*) h11_30_to_12
7272
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
@@ -75,9 +75,9 @@ from
7575
and ss_store_sk = s_store_sk
7676
and time_dim.t_hour = 11
7777
and time_dim.t_minute >= 30
78-
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
79-
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
80-
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
78+
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
79+
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
80+
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=3+2))
8181
and store.s_store_name = 'ese') s7,
8282
(select count(*) h12_to_12_30
8383
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
@@ -86,9 +86,9 @@ from
8686
and ss_store_sk = s_store_sk
8787
and time_dim.t_hour = 12
8888
and time_dim.t_minute < 30
89-
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
90-
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
91-
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
89+
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
90+
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
91+
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
9292
and store.s_store_name = 'ese') s8
9393
;
9494

0 commit comments

Comments
 (0)