Skip to content

Commit 7ab6040

Browse files
authored
Simplify tpc-ds q34, q73 a bit to help an optimizer (#7969)
1 parent 4d183f9 commit 7ab6040

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

ydb/library/benchmarks/queries/tpcds/yql/q34.sql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ select c_last_name
2222
and (household_demographics.hd_buy_potential = '>10000' or
2323
household_demographics.hd_buy_potential = 'Unknown')
2424
and household_demographics.hd_vehicle_count > 0
25-
and (case when household_demographics.hd_vehicle_count > 0
26-
then household_demographics.hd_dep_count/ household_demographics.hd_vehicle_count
27-
else null
28-
end) > 1.2
25+
and household_demographics.hd_dep_count / household_demographics.hd_vehicle_count > 1.2
2926
and date_dim.d_year in (2000,2000+1,2000+2)
3027
and store.s_county in ('Salem County','Terrell County','Arthur County','Oglethorpe County',
3128
'Lunenburg County','Perry County','Halifax County','Sumner County')

ydb/library/benchmarks/queries/tpcds/yql/q73.sql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ select c_last_name
2222
and (household_demographics.hd_buy_potential = '>10000' or
2323
household_demographics.hd_buy_potential = '5001-10000')
2424
and household_demographics.hd_vehicle_count > 0
25-
and case when household_demographics.hd_vehicle_count > 0 then
26-
household_demographics.hd_dep_count/ household_demographics.hd_vehicle_count else null end > 1
25+
and household_demographics.hd_dep_count / household_demographics.hd_vehicle_count > 1
2726
and date_dim.d_year in (2000,2000+1,2000+2)
2827
and store.s_county in ('Lea County','Furnas County','Pennington County','Bronx County')
2928
group by store_sales.ss_ticket_number,store_sales.ss_customer_sk) dj cross join {{customer}} as customer

0 commit comments

Comments
 (0)