Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

performance

Status
Not open for further replies.

murli1200

Technical User
Aug 18, 2006
3
US
how can i improve the performance of this query

Select
item_w.SLR_ID
, count(distinct item_loc.ITEM_ID ) TOTAL_ITEM_SHIP_INTL
from b_views.D_LOC item_loc
,b_views.D_W item_w
,b_views.D_C shpmt_loc
,b_views.D_CNTRIES cntry_1
,b_views.D_CNTRIES cntry_2
Where item_loc.ITEM_ID=item_w.ITEM_ID
And item_loc.S_CODE=shpmt_loc.S_CODE
And shpmt_loc.CNTRY_ID=cntry_1.CNTRY_ID
and item_w.SLR_CNTRY_ID = cntry_2.CNTRY_ID
and cntry_1.R_ROLLUP <> cntry_2.R_ROLLUP
And item_w.L_ID=1
AND item_w.P_FLAG<>'X'
Group by 1
 
Firstly, run an EXPLAIN, then check the Primary Indexes of the tables and finally check that you have fresh STATS

Then use the details of the Primary Index and the STATS to improve the step by step details of the EXPLAIN

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top