-2

Colleagues, based on your experience, what is the maximum page count of a table when statistics on this table doesn't matter? We have several relatively small tables - around 5000 8K pages.

But! Statistics really matter on them. If it is outdated, the queries hitting the table may run for hours (edit: queries with joins to these tables).

Please, share your experience.

George K
  • 2,306
  • 1
  • 17
  • 32

1 Answers1

4

You can do statistics separately to indexes

Pass 1: all statistics

@FragmentationLow = NULL, @FragmentationMedium = NULL, @FragmentationHigh = NULL,
@UpdateStatistics = 'ALL',
@OnlyModifiedStatistics = 'Y',

Pass 2: indexes

@UpdateStatistics = NULL, 

This covers points addressed in this answer: Does a re-index update statistics?

However, this separation is a foible of mine based on this article (and older articles)

Of course, the worst case scenario would be if you first rebuild your indexes, which also updates the index statistics by scanning the entire table, and later you run UPDATE STATISTICS using the default values, which again updates the index statistics but this time only with a default and smaller sample.

According to Brent Ozar Ola H's script is clever enough to not do this. But...

gbn
  • 70,237
  • 8
  • 167
  • 244