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

SQL Query Tunning - response (4) by Jessy Mahesh Kothapalli

$
0
0
Dear Dieter, Please find the below mentioned details , Kindly let me know if you required any info for same --SHOW W_PARTY_PER_D UNIQUE PRIMARY INDEX ( ROW_WID ) UNIQUE INDEX W_PARTY_PER_D_U1 ( DATASOURCE_NUM_ID ,INTEGRATION_ID , CONTACT_TYPE_I ); --SHOW TABLE WC_USER_D UNIQUE PRIMARY INDEX ( ROW_WID ) UNIQUE INDEX WC_USER_D_U1 ( INTEGRATION_ID ); LOGIN VARCHAR(50) --SHOW TABLE W_PARTY_ORG_D UNIQUE PRIMARY INDEX ( ROW_WID ) UNIQUE INDEX W_PARTY_ORG_D_U1 ( DATASOURCE_NUM_ID ,INTEGRATION_ID ); --HELP STATS W_PARTY_PER_D Date Time Unique Values Column Names 1 12/10/29 12:07:12 2,357 VIS_PR_BU_ID 2 12/10/29 12:11:07 39,370,920 INTEGRATION_ID 3 12/10/29 12:16:47 8,298,093 X_CONCAT_FULL_NAME 4 12/10/29 12:18:54 39,370,920 VIS_PR_BU_ID,INTEGRATION_ID --help stats WC_USER_D 12/10/29 11:06:33 174,648 PAR_INTEGRATION_ID 12/10/29 11:06:30 174,636 LOGIN 12/10/29 10:55:19 174,648 PAR_INTEGRATION_ID,LOGIN --help stats W_PARTY_ORG_D 12/10/29 10:55:18 5,620,010 INTEGRATION_ID 12/10/29 11:07:08 4,003,285 NAME --explain   Explain 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' 1) First, we lock a distinct TD_DEV."pseudo table" for read on a RowHash to prevent global deadlock for TD_DEV.A. 2) Next, we lock a distinct TD_DEV."pseudo table" for read on a RowHash to prevent global deadlock for TD_DEV.C. 3) We lock a distinct TD_DEV."pseudo table" for read on a RowHash to prevent global deadlock for TD_DEV.B. 4) We lock TD_DEV.A for read, we lock TD_DEV.C for read, and we lock TD_DEV.B for read. 5) We do an all-AMPs RETRIEVE step from TD_DEV.B by way of an all-rows scan with a condition of ("TD_DEV.B.LOGIN = 'MP_3005700'") into Spool 4 (all_amps), which is duplicated on all AMPs. The size of Spool 4 is estimated with low confidence to be 24 rows ( 480 bytes). The estimated time for this step is 0.07 seconds. 6) We do an all-AMPs JOIN step from Spool 4 (Last Use) by way of an all-rows scan, which is joined to TD_DEV.A by way of an all-rows scan with a condition of ("NOT (TD_DEV.A.VIS_PR_BU_ID IS NULL)"). Spool 4 and TD_DEV.A are joined using a single partition hash_ join, with a join condition of ("TD_DEV.A.INTEGRATION_ID = PAR_INTEGRATION_ID"). The input table TD_DEV.A will not be cached in memory. The result goes into Spool 5 (all_amps), which is duplicated on all AMPs. The size of Spool 5 is estimated with low confidence to be 24 rows (480 bytes). The estimated time for this step is 5 minutes and 23 seconds. 7) We do an all-AMPs JOIN step from Spool 5 (Last Use) by way of an all-rows scan, which is joined to TD_DEV.C by way of an all-rows scan with no residual conditions. Spool 5 and TD_DEV.C are joined using a single partition hash_ join, with a join condition of ( "VIS_PR_BU_ID = TD_DEV.C.INTEGRATION_ID"). The input table TD_DEV.C will not be cached in memory. The result goes into Spool 3 (all_amps), which is built locally on the AMPs. The size of Spool 3 is estimated with low confidence to be 1 row (50 bytes). The estimated time for this step is 1 minute and 16 seconds. 8) We do an all-AMPs SUM step to aggregate from Spool 3 (Last Use) by way of an all-rows scan , grouping by field1 ( TD_DEV.C.NAME ,( CASE WHEN (TD_DEV.C.NAME = 'TMCV') THEN ('COMMERCIAL VEHICLES') WHEN (TD_DEV.C.NAME = 'TMPC') THEN ('Passenger Vehicles') ELSE (TD_DEV.C.NAME) END)). Aggregate Intermediate Results are computed globally, then placed in Spool 1. The size of Spool 1 is estimated with low confidence to be 1 row (287 bytes). The estimated time for this step is 0.04 seconds. 9) Finally, we send out an END TRANSACTION step to all AMPs involved in processing the request. -> The contents of Spool 1 are sent back to the user as the result of statement 1. The total estimated time is 6 minutes and 39 seconds.  

Viewing all articles
Browse latest Browse all 27759

Trending Articles



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