Tune a simple inner join query

ε祈祈猫儿з 提交于 2019-12-02 19:41:00

问题


I am trying hard to tune my SQL query. I am relative not an expert in tuning SQL as i come from MDBMS tech

Here is the query

SELECT
  /*+ parallel(f 4) */
  F.DM_CUSTOMER_DKEY,
  P.PRODUCT_YEAR,
  SUM(F.ADVG_COST_ACTUALS) advg_cost_actuals
FROM DM_CUST_RENEWAL_ADV_FACT F
INNER JOIN DM_PRODUCT_HIERARCHY p
ON F.DM_PRODUCT_HKEY = P.DM_PRODUCT_HKEY
GROUP BY F.DM_CUSTOMER_DKEY,
  P.PRODUCT_YEAR
ORDER BY P.PRODUCT_YEAR 

I know fact table has multi billion records. Though, I am not sure how many as my count (*) statement take for ever to return the result. Any tuning/optimizing ideas around above statement would be greatly appreciated.

Thanks, NM

来源:https://stackoverflow.com/questions/17202810/tune-a-simple-inner-join-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!