Pages

Tuesday, 25 November 2014

optimizer_skip_scan_enabled performance issue and wrong stats in explain plan


Index skip scan performance issue and wrong stats during explain plan.

When you execute the below query it takes days to get the result and the plan show index skip scan with approximately 1hr estimated output but real output takes days ☹,So we disables the index skip scan and can see the result in ~15 in this case

SELECT AC_BRANCH, COUNT(*)
FROM ACTB_HISTORY
WHERE MODULE IN ('RT','UP')
AND CUST_GL = 'A'
AND trn_dt between '01-jan-2014' and '20-oct-2014'
AND USER_ID <> ‘’
AND AMOUNT_TAG = 'TXN'
GROUP BY AC_BRANCH
/



Disable the index scan and execute the plan.

SQL> alter session set "_optimizer_skip_scan_enabled"=FALSE;
SQL> EXECUTE THE QUERY
you CAN get result in 10mins but still the plan shows wrong status in time but the cost is reduced.

No comments:

Post a Comment