Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

SQL Query Tunning - response (2) by m.kothapally@gmail.com

$
0
0
  Dear all, Please look at below mentioned issue , this query was runing very long time nearly 545 hours, I did proper tuning like collect stats and seconday index creation as per required columns .now it takes 2 min:43 sec,This query should be run with in 2,3 sec (NOT minutes) as if it is running in oracle (2,3 sec), because  this is login query for RPD. 1 ) VIS_PR_BU_ID column having 2,06,77,318 null values but we are using in join coindition any how we eleminated by using IS NOT NULL 2) Created JOIN INX for WHERE A.INTEGRATION_ID = B.PAR_INTEGRATION_ID Still it takes 2 & 3 min , Please suggested me i'm not wrong SELECT /*+index(a W_PARTY_PER_D_U2) index(c S SHAI2)*/ DISTINCT C.NAME , CASE WHEN C.NAME ='TMCV' THEN 'COMMERCIAL VEHICLES' WHEN C.NAME ='TMPC' THEN 'Passenger Vehicles' ELSE C.NAME END FROM W_PARTY_PER_D A,WC_USER_D B, W_PARTY_ORG_D C WHERE A.INTEGRATION_ID = B.PAR_INTEGRATION_ID AND A.VIS_PR_BU_ID = C.INTEGRATION_ID AND B.LOGIN = 'MP_3005700' select count(1) from W_PARTY_PER_D --3,93,70,920 select count(1) from WC_USER_D --174,648 select count(1) from W_PARTY_ORG_D--56,20,010 The total estimated time is 3 minutes and 13 seconds. Regards, Mahesh

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>