Skip to Main Content
  • Questions
  • performance tuning - sql slows down after gather stats

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, krishna.

Asked: May 07, 2018 - 8:05 am UTC

Last updated: May 11, 2018 - 8:32 am UTC

Version: 12c

Viewed 1000+ times

You Asked

Hi ,

I have faced a situation where sql id plan hash value is changed due stats gather on one of table


currently i dont understand why this stats gathering cause chnage in plan and due to which execution time is poor now

can you guide what i need to check here

and Connor said...

You haven't really given us a lot to work with - *any* kind of stats change *might* result in a different plan.

If you were happy with the plan before the stats change, then perhaps look at:

- reverting the stats to their previous value, eg

https://blog.dbi-services.com/how-to-retrieve-previous-table-statistics-using-oracle-dbmsstats/

- using SQL Plan Management to lock down the plan

https://blogs.oracle.com/optimizer/how-to-use-sql-plan-management

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

SPM on 12c

Rajeshwaran, Jeyabal, May 14, 2018 - 12:33 pm UTC

Since you were on 12c, it is now possible to get historical plans from AWR and loaded them into SPM.

https://sqlmaria.com/2017/12/19/sql-plan-management-selective-automatic-plan-capture-now-available/

More to Explore

Performance

Get all the information about database performance in the Database Performance guide.