Hi Dieter,
First of all thanks for your response.
I don't have much experience with tera, i have checked with DBA's who are taking care of tera, they said there is no change in spool allocating to adhoc users. we don't have permissions on tables so i don't no how to check skew on a tabe, but i am sure that there is no change in plan as i said we have been using the same query for last 7 months. I don't no how to run stats, i think DBA's run stats, i will ask DBA's do that. Please let me know if i can reun stats even if I don't have permissions on tables.
I don't no how to check DDL on a query but I am attaching Explain here ....
Explanation
1) First, we lock SVC_PKG_T.GBL_SVC_DSPCH_FACT for access, we lock
SVC_PKG_T.GBL_SVC_DSPCH_ITM_FACT for access, we lock
itm_pkg_t.BASE_PROD_HIER_DIM for access, we lock
PARTY_PKG_T.ASSOC_DIM for access, and we lock
CORP_DRM_PKG_T.CHNL_HIER for access.
2) Next, we execute the following steps in parallel.
1) We do an all-AMPs RETRIEVE step from
SVC_PKG_T.GBL_SVC_DSPCH_FACT by way of an all-rows scan with
a condition of (
"((CAST((SVC_PKG_T.GBL_SVC_DSPCH_FACT.DSPCH_CRT_DTS) AS
DATE))>= DATE '2013-06-22') AND
(((CAST((SVC_PKG_T.GBL_SVC_DSPCH_FACT.DSPCH_CRT_DTS) AS
DATE))<= DATE '2013-06-28') AND
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 2.02000000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 7.77700000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 5.85800000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 1.10000000000000E 001) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 1.43500000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 4.74700000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 3.23200000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 7.87800000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 1.41500000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 7.07000000000000E 002) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 9.59500000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 8.58500000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 3.73700000000000E 003) OR
((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 3.69600000000000E 003
)))))))))))))))") into Spool 13 (all_amps) (compressed
columns allowed), which is built locally on the AMPs. Then
we do a SORT to order Spool 13 by the hash code of (
SVC_PKG_T.GBL_SVC_DSPCH_FACT.LCL_CHNL_CD,
SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999')(FLOAT)). The size of Spool 13 is
estimated with no confidence to be 7,723,607 rows (
3,359,769,045 bytes). The estimated time for this step is
1.94 seconds.
2) We do an all-AMPs RETRIEVE step from CORP_DRM_PKG_T.CHNL_HIER
by way of an all-rows scan with no residual conditions into
Spool 14 (all_amps) (compressed columns allowed), which is
duplicated on all AMPs. Then we do a SORT to order Spool 14
by the hash code of (CORP_DRM_PKG_T.CHNL_HIER.BU_ID (INTEGER)
(FLOAT), TRANSLATE((CORP_DRM_PKG_T.CHNL_HIER.LCL_CHNL_CODE
)USING LATIN_TO_UNICODE)(CHAR(5), CHARACTER SET UNICODE, NOT
CASESPECIFIC)). The size of Spool 14 is estimated with high
confidence to be 6,002,880 rows (672,322,560 bytes). The
estimated time for this step is 0.46 seconds.
3) We execute the following steps in parallel.
1) We do an all-AMPs JOIN step from Spool 13 (Last Use) by way
of a RowHash match scan, which is joined to Spool 14 (Last
Use) by way of a RowHash match scan. Spool 13 and Spool 14
are left outer joined using a merge join, with a join
condition of ("((ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= (BU_ID (INTEGER) )) AND
(LCL_CHNL_CD = (TRANSLATE((LCL_CHNL_CODE )USING
LATIN_TO_UNICODE)))"). The result goes into Spool 15
(all_amps) (compressed columns allowed), which is built
locally on the AMPs. Then we do a SORT to order Spool 15 by
the hash code of (
SVC_PKG_T.GBL_SVC_DSPCH_FACT.SYS_ITM_CLS_CD). The size of
Spool 15 is estimated with no confidence to be 7,723,607 rows
(4,008,552,033 bytes). The estimated time for this step is
0.44 seconds.
2) We do an all-AMPs RETRIEVE step from
itm_pkg_t.BASE_PROD_HIER_DIM by way of an all-rows scan with
no residual conditions into Spool 16 (all_amps) (compressed
columns allowed), which is duplicated on all AMPs. Then we
do a SORT to order Spool 16 by the hash code of (
TRANSLATE((itm_pkg_t.BASE_PROD_HIER_DIM.ITM_CLS_CODE )USING
LATIN_TO_UNICODE)(CHAR(5), CHARACTER SET UNICODE, NOT
CASESPECIFIC)). The size of Spool 16 is estimated with high
confidence to be 18,408,000 rows (1,399,008,000 bytes). The
estimated time for this step is 0.72 seconds.
4) We execute the following steps in parallel.
1) We do an all-AMPs JOIN step from Spool 15 (Last Use) by way
of a RowHash match scan, which is joined to Spool 16 (Last
Use) by way of a RowHash match scan. Spool 15 and Spool 16
are left outer joined using a merge join, with a join
condition of ("SYS_ITM_CLS_CD = (TRANSLATE((ITM_CLS_CODE
)USING LATIN_TO_UNICODE))"). The result goes into Spool 17
(all_amps) (compressed columns allowed), which is
redistributed by the hash code of (
SVC_PKG_T.GBL_SVC_DSPCH_FACT.SVC_DSPCH_ID) to all AMPs. Then
we do a SORT to order Spool 17 by row hash. The size of
Spool 17 is estimated with no confidence to be 15,428,039
rows (8,917,406,542 bytes). The estimated time for this step
is 4.13 seconds.
2) We do an all-AMPs RETRIEVE step from
SVC_PKG_T.GBL_SVC_DSPCH_ITM_FACT by way of an all-rows scan
with no residual conditions into Spool 18 (all_amps)
(compressed columns allowed), which is redistributed by the
hash code of (SVC_PKG_T.GBL_SVC_DSPCH_ITM_FACT.SVC_DSPCH_ID)
to all AMPs. Then we do a SORT to order Spool 18 by row hash.
The size of Spool 18 is estimated with high confidence to be
73,554,636 rows (3,457,067,892 bytes). The estimated time
for this step is 2.95 seconds.
5) We do an all-AMPs JOIN step from Spool 17 (Last Use) by way of a
RowHash match scan, which is joined to Spool 18 (Last Use) by way
of a RowHash match scan. Spool 17 and Spool 18 are left outer
joined using a merge join, with a join condition of (
"SVC_DSPCH_ID = SVC_DSPCH_ID"). The result goes into Spool 19
(all_amps) (compressed columns allowed), which is redistributed by
the hash code of (SVC_PKG_T.GBL_SVC_DSPCH_FACT.ASSOC_BDGE_NBR) to
all AMPs. Then we do a SORT to order Spool 19 by row hash. The
size of Spool 19 is estimated with no confidence to be 146,926,662
rows (87,274,437,228 bytes). The estimated time for this step is
38.89 seconds.
6) We do an all-AMPs JOIN step from PARTY_PKG_T.ASSOC_DIM by way of a
RowHash match scan with no residual conditions, which is joined to
Spool 19 (Last Use) by way of a RowHash match scan.
PARTY_PKG_T.ASSOC_DIM and Spool 19 are right outer joined using a
merge join, with condition(s) used for non-matching on right table
("NOT (ASSOC_BDGE_NBR IS NULL)"), with a join condition of (
"((CAST(({RightTable}.DSPCH_CRT_DTS) AS DATE))<=
PARTY_PKG_T.ASSOC_DIM.SRC_EFF_END_DT) AND
(((CAST(({RightTable}.DSPCH_CRT_DTS) AS DATE))>=
PARTY_PKG_T.ASSOC_DIM.SRC_EFF_STRT_DT) AND (ASSOC_BDGE_NBR =
PARTY_PKG_T.ASSOC_DIM.ASSOC_BDGE_NBR ))"). The result goes into
Spool 12 (group_amps), which is built locally on the AMPs. The
result spool file will not be cached in memory. The size of Spool
12 is estimated with no confidence to be 3,289,626,154 rows (
2,835,657,744,748 bytes). The estimated time for this step is 2
minutes and 18 seconds.
7) Finally, we send out an END TRANSACTION step to all AMPs involved
in processing the request.
-> The contents of Spool 12 are sent back to the user as the result
of statement 1. The total estimated time is 3 minutes and 4
seconds.
Thanks,
Chaitanys.
Hi Dieter,
First of all thanks for your response.
I don't have much experience with tera, i have checked with DBA's who are taking care of tera, they said there is no change in spool allocating to adhoc users. we don't have permissions on tables so i don't no how to check skew on a tabe, but i am sure that there is no change in plan as i said we have been using the same query for last 7 months. I don't no how to run stats, i think DBA's run stats, i will ask DBA's do that. Please let me know if i can reun stats even if I don't have permissions on tables.
I don't no how to check DDL on a query but I am attaching Explain here ....
Explanation
1) First, we lock SVC_PKG_T.GBL_SVC_DSPCH_FACT for access, we lock
SVC_PKG_T.GBL_SVC_DSPCH_ITM_FACT for access, we lock
itm_pkg_t.BASE_PROD_HIER_DIM for access, we lock
PARTY_PKG_T.ASSOC_DIM for access, and we lock
CORP_DRM_PKG_T.CHNL_HIER for access.
2) Next, we execute the following steps in parallel.
1) We do an all-AMPs RETRIEVE step from
SVC_PKG_T.GBL_SVC_DSPCH_FACT by way of an all-rows scan with
a condition of (
"((CAST((SVC_PKG_T.GBL_SVC_DSPCH_FACT.DSPCH_CRT_DTS) AS
DATE))>= DATE '2013-06-22') AND
(((CAST((SVC_PKG_T.GBL_SVC_DSPCH_FACT.DSPCH_CRT_DTS) AS
DATE))<= DATE '2013-06-28') AND
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 2.02000000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 7.77700000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 5.85800000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 1.10000000000000E 001) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 1.43500000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 4.74700000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 3.23200000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 7.87800000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 1.41500000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 7.07000000000000E 002) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 9.59500000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 8.58500000000000E 003) OR
(((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 3.73700000000000E 003) OR
((SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= 3.69600000000000E 003
)))))))))))))))") into Spool 13 (all_amps) (compressed
columns allowed), which is built locally on the AMPs. Then
we do a SORT to order Spool 13 by the hash code of (
SVC_PKG_T.GBL_SVC_DSPCH_FACT.LCL_CHNL_CD,
SVC_PKG_T.GBL_SVC_DSPCH_FACT.ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999')(FLOAT)). The size of Spool 13 is
estimated with no confidence to be 7,723,607 rows (
3,359,769,045 bytes). The estimated time for this step is
1.94 seconds.
2) We do an all-AMPs RETRIEVE step from CORP_DRM_PKG_T.CHNL_HIER
by way of an all-rows scan with no residual conditions into
Spool 14 (all_amps) (compressed columns allowed), which is
duplicated on all AMPs. Then we do a SORT to order Spool 14
by the hash code of (CORP_DRM_PKG_T.CHNL_HIER.BU_ID (INTEGER)
(FLOAT), TRANSLATE((CORP_DRM_PKG_T.CHNL_HIER.LCL_CHNL_CODE
)USING LATIN_TO_UNICODE)(CHAR(5), CHARACTER SET UNICODE, NOT
CASESPECIFIC)). The size of Spool 14 is estimated with high
confidence to be 6,002,880 rows (672,322,560 bytes). The
estimated time for this step is 0.46 seconds.
3) We execute the following steps in parallel.
1) We do an all-AMPs JOIN step from Spool 13 (Last Use) by way
of a RowHash match scan, which is joined to Spool 14 (Last
Use) by way of a RowHash match scan. Spool 13 and Spool 14
are left outer joined using a merge join, with a join
condition of ("((ORIG_ORD_BU_ID (FLOAT, FORMAT
'-9.99999999999999E-999'))= (BU_ID (INTEGER) )) AND
(LCL_CHNL_CD = (TRANSLATE((LCL_CHNL_CODE )USING
LATIN_TO_UNICODE)))"). The result goes into Spool 15
(all_amps) (compressed columns allowed), which is built
locally on the AMPs. Then we do a SORT to order Spool 15 by
the hash code of (
SVC_PKG_T.GBL_SVC_DSPCH_FACT.SYS_ITM_CLS_CD). The size of
Spool 15 is estimated with no confidence to be 7,723,607 rows
(4,008,552,033 bytes). The estimated time for this step is
0.44 seconds.
2) We do an all-AMPs RETRIEVE step from
itm_pkg_t.BASE_PROD_HIER_DIM by way of an all-rows scan with
no residual conditions into Spool 16 (all_amps) (compressed
columns allowed), which is duplicated on all AMPs. Then we
do a SORT to order Spool 16 by the hash code of (
TRANSLATE((itm_pkg_t.BASE_PROD_HIER_DIM.ITM_CLS_CODE )USING
LATIN_TO_UNICODE)(CHAR(5), CHARACTER SET UNICODE, NOT
CASESPECIFIC)). The size of Spool 16 is estimated with high
confidence to be 18,408,000 rows (1,399,008,000 bytes). The
estimated time for this step is 0.72 seconds.
4) We execute the following steps in parallel.
1) We do an all-AMPs JOIN step from Spool 15 (Last Use) by way
of a RowHash match scan, which is joined to Spool 16 (Last
Use) by way of a RowHash match scan. Spool 15 and Spool 16
are left outer joined using a merge join, with a join
condition of ("SYS_ITM_CLS_CD = (TRANSLATE((ITM_CLS_CODE
)USING LATIN_TO_UNICODE))"). The result goes into Spool 17
(all_amps) (compressed columns allowed), which is
redistributed by the hash code of (
SVC_PKG_T.GBL_SVC_DSPCH_FACT.SVC_DSPCH_ID) to all AMPs. Then
we do a SORT to order Spool 17 by row hash. The size of
Spool 17 is estimated with no confidence to be 15,428,039
rows (8,917,406,542 bytes). The estimated time for this step
is 4.13 seconds.
2) We do an all-AMPs RETRIEVE step from
SVC_PKG_T.GBL_SVC_DSPCH_ITM_FACT by way of an all-rows scan
with no residual conditions into Spool 18 (all_amps)
(compressed columns allowed), which is redistributed by the
hash code of (SVC_PKG_T.GBL_SVC_DSPCH_ITM_FACT.SVC_DSPCH_ID)
to all AMPs. Then we do a SORT to order Spool 18 by row hash.
The size of Spool 18 is estimated with high confidence to be
73,554,636 rows (3,457,067,892 bytes). The estimated time
for this step is 2.95 seconds.
5) We do an all-AMPs JOIN step from Spool 17 (Last Use) by way of a
RowHash match scan, which is joined to Spool 18 (Last Use) by way
of a RowHash match scan. Spool 17 and Spool 18 are left outer
joined using a merge join, with a join condition of (
"SVC_DSPCH_ID = SVC_DSPCH_ID"). The result goes into Spool 19
(all_amps) (compressed columns allowed), which is redistributed by
the hash code of (SVC_PKG_T.GBL_SVC_DSPCH_FACT.ASSOC_BDGE_NBR) to
all AMPs. Then we do a SORT to order Spool 19 by row hash. The
size of Spool 19 is estimated with no confidence to be 146,926,662
rows (87,274,437,228 bytes). The estimated time for this step is
38.89 seconds.
6) We do an all-AMPs JOIN step from PARTY_PKG_T.ASSOC_DIM by way of a
RowHash match scan with no residual conditions, which is joined to
Spool 19 (Last Use) by way of a RowHash match scan.
PARTY_PKG_T.ASSOC_DIM and Spool 19 are right outer joined using a
merge join, with condition(s) used for non-matching on right table
("NOT (ASSOC_BDGE_NBR IS NULL)"), with a join condition of (
"((CAST(({RightTable}.DSPCH_CRT_DTS) AS DATE))<=
PARTY_PKG_T.ASSOC_DIM.SRC_EFF_END_DT) AND
(((CAST(({RightTable}.DSPCH_CRT_DTS) AS DATE))>=
PARTY_PKG_T.ASSOC_DIM.SRC_EFF_STRT_DT) AND (ASSOC_BDGE_NBR =
PARTY_PKG_T.ASSOC_DIM.ASSOC_BDGE_NBR ))"). The result goes into
Spool 12 (group_amps), which is built locally on the AMPs. The
result spool file will not be cached in memory. The size of Spool
12 is estimated with no confidence to be 3,289,626,154 rows (
2,835,657,744,748 bytes). The estimated time for this step is 2
minutes and 18 seconds.
7) Finally, we send out an END TRANSACTION step to all AMPs involved
in processing the request.
-> The contents of Spool 12 are sent back to the user as the result
of statement 1. The total estimated time is 3 minutes and 4
seconds.
Thanks,
Chaitanys.