Skip to content

Commit

Permalink
Fix pg tpc-ds query texts (#1557)
Browse files Browse the repository at this point in the history
  • Loading branch information
resetius authored Feb 2, 2024
1 parent 2a5a5bd commit 205480d
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion ydb/library/benchmarks/queries/tpcds/pg/q32.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ from
,{{item}}
,{{date_dim}}
where
i_manufact_id = 269
i_manufact_id = 66
and i_item_sk = cs_item_sk
and d_date between '2002-03-29'::date and
(cast('2002-03-29' as date) + interval '90' day)::date
Expand Down
2 changes: 1 addition & 1 deletion ydb/library/benchmarks/queries/tpcds/pg/q33.sql
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ where i_category in ('Books'))
i_manufact_id
from
{{item}}
where i_category in ('Books'))
where i_category in ('Home'))
and ws_item_sk = i_item_sk
and ws_sold_date_sk = d_date_sk
and d_year = 1998
Expand Down
2 changes: 1 addition & 1 deletion ydb/library/benchmarks/queries/tpcds/pg/q45.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ select ca_zip, ca_county, sum(ws_sales_price)
)
)
and ws_sold_date_sk = d_date_sk
and d_qoy = 2 and d_year = 1998
and d_qoy = 1 and d_year = 1998
group by ca_zip, ca_county
order by ca_zip, ca_county
limit 100;
Expand Down
4 changes: 2 additions & 2 deletions ydb/library/benchmarks/queries/tpcds/pg/q46.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ select c_last_name
and store_sales.ss_store_sk = store.s_store_sk
and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
and store_sales.ss_addr_sk = customer_address.ca_address_sk
and (household_demographics.hd_dep_count = 5 or
household_demographics.hd_vehicle_count= 3)
and (household_demographics.hd_dep_count = 0 or
household_demographics.hd_vehicle_count= 1)
and date_dim.d_dow in (6,0)
and date_dim.d_year in (2000,2000+1,2000+2)
and store.s_city in ('Five Forks','Oakland','Fairview','Winchester','Farmington')
Expand Down
2 changes: 1 addition & 1 deletion ydb/library/benchmarks/queries/tpcds/pg/q59.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ with wss as
from wss,{{store}},{{date_dim}} d
where d.d_week_seq = wss.d_week_seq and
ss_store_sk = s_store_sk and
d_month_seq between 1185 and 1185 + 11) y,
d_month_seq between 1205 and 1205 + 11) y,
(select s_store_name s_store_name2,wss.d_week_seq d_week_seq2
,s_store_id s_store_id2,sun_sales sun_sales2
,mon_sales mon_sales2,tue_sales tue_sales2
Expand Down
4 changes: 2 additions & 2 deletions ydb/library/benchmarks/queries/tpcds/pg/q66.sql
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ select
and cs_sold_date_sk = d_date_sk
and cs_sold_time_sk = t_time_sk
and cs_ship_mode_sk = sm_ship_mode_sk
and d_year = 2002
and t_time between 49530 AND 49530+28800
and d_year = 2001
and t_time between 9453 AND 9453+28800
and sm_carrier in ('MSC','GERMA')
group by
w_warehouse_name
Expand Down
2 changes: 1 addition & 1 deletion ydb/library/benchmarks/queries/tpcds/pg/q82.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ select i_item_id
and inv_item_sk = i_item_sk
and d_date_sk=inv_date_sk
and d_date between cast('2001-01-28' as date) and (cast('2001-01-28' as date) + interval '60' day)::date
and i_manufact_id in (437,129,727,663)
and i_manufact_id in (80,675,292,17)
and inv_quantity_on_hand between 100 and 500
and ss_item_sk = i_item_sk
group by i_item_id,i_item_desc,i_current_price
Expand Down
66 changes: 33 additions & 33 deletions ydb/library/benchmarks/queries/tpcds/pg/q88.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,69 @@ select *
from
(select count(*) h8_30_to_9
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 8
and time_dim.t_minute >= 30
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s1,
(select count(*) h9_to_9_30
(select count(*) h9_to_9_30
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 9
and ss_store_sk = s_store_sk
and time_dim.t_hour = 9
and time_dim.t_minute < 30
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s2,
(select count(*) h9_30_to_10
(select count(*) h9_30_to_10
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 9
and time_dim.t_minute >= 30
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=3+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s3,
(select count(*) h10_to_10_30
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 10
and time_dim.t_hour = 10
and time_dim.t_minute < 30
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s4,
(select count(*) h10_30_to_11
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 10
and time_dim.t_hour = 10
and time_dim.t_minute >= 30
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s5,
(select count(*) h11_to_11_30
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 11
and time_dim.t_minute < 30
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s6,
(select count(*) h11_30_to_12
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
Expand All @@ -75,9 +75,9 @@ from
and ss_store_sk = s_store_sk
and time_dim.t_hour = 11
and time_dim.t_minute >= 30
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s7,
(select count(*) h12_to_12_30
from {{store_sales}}, {{household_demographics}} , {{time_dim}}, {{store}}
Expand All @@ -86,9 +86,9 @@ from
and ss_store_sk = s_store_sk
and time_dim.t_hour = 12
and time_dim.t_minute < 30
and ((household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2) or
(household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
(household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2))
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s8
;

Expand Down

0 comments on commit 205480d

Please sign in to comment.