cancel
Showing results for 
Search instead for 
Did you mean: 

Is CREATE STATISTICS safe to run with activity in the database?

justin_willey
Participant
2,879

We have a v10.0.1 database that has had a lot of data removed, and has now been rebuilt. There are a few rather vague indications that the statistics may be out of date and causing some odd plans. We don't know this is the case but it seems something worth eliminating.

My question is whether it is safe to run CREATE STATISTICS when there is any other activity in the database or should we take it off line (to other users) while this is done. Obviously we would chose a quite time, but that isn't the same as no other activity.

The docs only say "The process of running CREATE STATISTICS performs a complete scan of the table. For this reason, careful consideration should be made before issuing a CREATE STATISTICS statement."

Any experience / thoughts appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

I am unaware of issues related to running CREATE STATISTICS during production operation.

That said, however, I would think twice about running the statement(s) during peak production, especially on a larger database file. Executing the statement will alter the cache contents and consequently can have negative affects on production queries. It will also (naturally) cause considerable sequential I/O to the disk.

justin_willey
Participant
0 Kudos

Many thanks Glenn, that's how I read it but that "careful consideration" phrase made me pause. It sounds like we should choose a quiet time - that's much easier than throwing every last user out.

justin_willey
Participant
0 Kudos

CREATE STATISTICS did indeed run happily with a low level of other activity. Thanks Glenn

Former Member
0 Kudos

You're welcome!

Answers (0)