Online Tutorials & Training Materials | STechies.com
Register Login

How to Check What Execution Plan the Query Used Yesterday or Some days Back?

|| || 2

How to Check What Execution Plan the Query Used Yesterday or Some days Back?
Stechies

Hello Experts,

Today I had an issue for slow running query for one of our warehouse database, where tables and indexes has latest stats yesterday no new data load, "dbms_xplan.display_awr" lists multiple explain plans and the query is using a same plan generated sometime back on 2014, however a latest plan also do exists which was generated on Aug/2015. Query was same with no change.

The same query ran fine yesterday but slow today. Is any one aware if we do have any option like how to check what execution plan the query used yesterday or since some days back ?

Kindly share your views here, thanks in advance.


Comments

  • 17 Sep 2015 11:59 am Helpful Answer

    Find out SQL id fo that query and using the query to find out query plan with timings, select SQL_ID,PLAN_HASH_VALUE, OPERATION, COST, TIMESTAMP from DBA_HIST_SQL_PLAN where SQL_ID='g9ks2772vgzdy'

    Select SAMPLE_TIME,SESSION_ID,SQL_PLAN_HASH_VALUE from DBA_HIST_ACTIVE_SESS_HISTORY where SQL_ID='9hha8mvkmmjfd' order by 1;

  • 17 Sep 2015 12:00 pm Helpful Answer

    Check the data volume processed by the query. As you are saying plan is same then response time can change due to change in data volume.