Skip to Main Content
  • Questions
  • Stat gather impact on production environment

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Gyan.

Asked: October 04, 2019 - 9:25 am UTC

Last updated: October 21, 2019 - 12:37 pm UTC

Version: 11g/12c

Viewed 1000+ times

You Asked

On OLTP production environment, during huge transaction period, what is an impact if we run the stat gather of used schema for transaction???, It will missed any indexes, and other operation issues???

and Connor said...

gathering stats is equivalent to running a series of full table scans on your tables. In terms of CPU, if you run it serially, then it will only use a single core on your server. In terms of I/O, it depends on what bandwidth your storage can support.

Obviously we recommend running it during as quiet a period as possible to minimise impact, but assuming your using the defaults, it will only gather stats on those objects that need it (ie, are stale or missing statistics).

And don't forget, you generally don't need to get over obsessive with statistics. A table going from 100 million rows to 150 million rows is still just "a big table", so optimizer plans are typically unlikely to change much. Often it is the changes in *smaller* tables (from 10 rows to 1000 rows) that have a bigger impact on plans, and these are very cheap to gather stats on .

Other options include if you have a standby database, you can gather stats on that database and import them into your production database. But if gathering stats is going to push you "over the edge" in terms of server resources, it strikes me that you are running very very close to the limit anyway?

Rating

  (2 ratings)

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

Comments

on defaults

Rajeshwaran, Jeyabal, October 07, 2019 - 2:00 pm UTC

.... but assuming your using the defaults, it will only gather stats on those objects that need it (ie, are stale or missing statistics).....

the "default" in the above context refers to the in-build auto stats gathering job or gathering the stats explicitly (using dbms_stats API) on objects with username and object name specified and letting other parameters to defaults. Kindly confirm.
Connor McDonald
October 21, 2019 - 12:37 pm UTC

auto stats gathering job

A reader, October 12, 2019 - 8:58 am UTC


More to Explore

Performance

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