You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
explain analyze with inv as
(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
,stdev,mean, case mean when 0 then null else stdev/mean end cov
from(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
,stddev_samp(inv_quantity_on_hand) stdev,avg(inv_quantity_on_hand) mean
from inventory
,item
,warehouse
,date_dim
where inv_item_sk = i_item_sk
and inv_warehouse_sk = w_warehouse_sk
and inv_date_sk = d_date_sk
and d_year =1999
group by w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy) foo
where case mean when 0 then 0 else stdev/mean end > 1)
select inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean, inv1.cov
,inv2.w_warehouse_sk,inv2.i_item_sk,inv2.d_moy,inv2.mean, inv2.cov
from inv inv1,inv inv2
where inv1.i_item_sk = inv2.i_item_sk
and inv1.w_warehouse_sk = inv2.w_warehouse_sk
and inv1.d_moy=4
and inv2.d_moy=4+1
order by inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean,inv1.cov
,inv2.d_moy,inv2.mean, inv2.cov;
It uses broadcast motion instead of hash redistributed motion for the join result of warehouse and inventory as it estimates that there are only 1 row for the result. For the join condition 'inventory.inv_warehouse_sk = warehouse.w_warehouse_sk' , orca doesn't know the foreign key info , so it gives out a wrong estimation.
Apache Cloudberry version
No response
What happened
TPCDS 39 SQL
the result of
EXPLAIN ANALYZE
It uses broadcast motion instead of hash redistributed motion for the join result of
warehouse
andinventory
as it estimates that there are only 1 row for the result. For the join condition 'inventory.inv_warehouse_sk = warehouse.w_warehouse_sk' , orca doesn't know the foreign key info , so it gives out a wrong estimation.What you think should happen instead
No response
How to reproduce
psql -U gpadmin -v ON_ERROR_STOP=1 -A -q -t -P pager=off -v EXPLAIN_ANALYZE=" " -f /home/gpadmin/workspace/TPC-DS-HashData/05_sql/139.dsbench.39.sql
Operating System
centos7
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: