Multiple execution plan for the same sql_id
Currently I am working on a performance issue with a quey whose performance get worse along the day maybe related with an inacurete stats. My scenario is:
Version:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production
SQL:
SELECT *
FROM ESB_ATCOMRESTASK
WHERE 1=1
AND parent_batchNo IS NULL
AND NOT EXISTS
(SELECT '1'
FROM tr_upload up,
esb_atComResTask tsk2
WHERE up.batchNo = tsk2.batchNo
AND (tsk2.b atchNo = esb_atComResTask.batchNo
OR tsk2.parent_batchNo = esb_atComResTask.batchNo)