Dear Tom ,
Thanks for your help for DBA world. could you please clarify my issue.
Database : 11.2.0.3 running on 08 node RAC Exadata server
only one DB is running. all of sudden , performance of DB wend
bad. after analysis identified that there are lots of Cluster waits. that too for particular below MERGE query very high.
MERGE INTO range_hash PA
USING(SELECT P2(I).range_hashID range_hashID,
P2(I).testID testID,
P2(I).range_hashKEY range_hashKEY,
P2(I).ATTRIBUTEVALUE ATTRIBUTEVALUE,
P2(I).ACTIVE ACTIVE,
P2(I).CREATIONDATE CREATIONDATE
FROM DUAL/*TABLE(P2) TMP*/) SRC
-- FROM PRODATTRIBUTE_GTT TMP) SRC
ON (PA.testID = SRC.testID AND
PA.range_hashKEY = SRC.range_hashKEY AND
PA.CREATIONDATE = SRC.CREATIONDATE)
WHEN MATCHED THEN
UPDATE
SET --PA.testID = SRC.testID,
-- PA.range_hashKEY = SRC.range_hashKEY,
--##PA.range_hashVALUE = SRC.ATTRIBUTEVALUE,
PA.ACTIVE = SRC.ACTIVE,
--PA.CREATIONDATE = SRC.CREATIONDATE,
PA.LASTMODDATE = (CASE
WHEN PA.LASTMODDATE > SYSDATE--SYSTIMESTAMP
THEN PA.LASTMODDATE + 1/24/60/60
ELSE SYSDATE--SYSTIMESTAMP
END)
WHEN NOT MATCHED THEN
INSERT(PA.range_hashID,
PA.testID,
PA.range_hashKEY,
PA.range_hashVALUE,
PA.ACTIVE,
PA.CREATIONDATE,
PA.LASTMODDATE,
PA.MODCOUNT)
VALUES(range_hash_SEQ.NEXTVAL,
SRC.testID,
SRC.range_hashKEY,
SRC.ATTRIBUTEVALUE,
SRC.ACTIVE,
SRC.CREATIONDATE,
SYSDATE,
0)
;
table range_hash is sub partitioned by range-hash. both partition/sub partition columns are number data type column
from AWR report :
Cluster Wait Time (s) Executions %Total Elapsed Time(s) %Clu %CPU %IO SQL Id SQL Module SQL Text
64,810.51 810 61.38 89,956.58 72.05 9.53 2.39 5psw902g9b88m PA_OLOCK MERGE INTO range_hash PA...
Execution plan as follows :
Plan hash value: 1572288415
----------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost | Pstart| Pstop |
----------------------------------------------------------------------------------------------------------------
| 0 | MERGE STATEMENT | | | | 5 | | |
| 1 | MERGE | range-hash | | | | | |
| 2 | VIEW | | | | | | |
| 3 | SEQUENCE | range-hash_SEQ | | | | | |
| 4 | MERGE JOIN OUTER | | 1 | 99 | 5 | | |
| 5 | FAST DUAL | | 1 | | 1 | | |
| 6 | PARTITION RANGE SINGLE | | 1 | 99 | 4 | KEY | KEY |
| 7 | PARTITION HASH ALL | | 1 | 99 | 4 | 1 | LAST |
| 8 | TABLE ACCESS BY LOCAL INDEX ROWID| range-hash | 1 | 99 | 4 | KEY | KEY |
| 9 | INDEX RANGE SCAN | PA_PRODUCT_KEY_P | 1 | | 3 | KEY | KEY |
----------------------------------------------------------------------------------------------------------------
we have latest statistics. we have same merge query running on
another DB. there it is using partition pruning, running faster( 2sec) and compared all aspects from both. everything is almost same ( partition type,indexes,). but here it is taking 110 sec per execution.
not sure why in this DB , partition pruning is not taking place?
any other way to force partition pruning? or what are the possible causes for not to choose partition pruning ?
could you please help us to understand what went wrong all of sudden?
Thanks in advance