Skip to main content
Made title more specific
Link
Martin Smith
  • 86.5k
  • 15
  • 252
  • 342

How does sampling work when updating statistics?

Tweeted twitter.com/#!/StackDBAs/status/303131419234930688
added 62 characters in body; edited title
Source Link
Nick Chammas
  • 14.8k
  • 17
  • 76
  • 123

Sql Server Statistics - how How does sampling work?

I have (several)several massive tables. II'd like to ensure their statistics are up to date via a weekly maintenance plan.

However, doing so is taking too much time.

If I specify

WITH SAMPLE 50 PERCENT

WITH SAMPLE 50 PERCENT

does SqlSQL Server then sample:

a) the first 50% of pages b) every other page c) some other strategy

  1. the first 50% of pages
  2. every other page
  3. or some other strategy?

BOLBOL is not clear on this.

Many thanks.

Sql Server Statistics - how does sampling work?

I have (several) massive tables. I like to ensure their statistics are up to date via a weekly maintenance plan.

However, doing so is taking too much time.

If I specify

WITH SAMPLE 50 PERCENT

does Sql Server then sample

a) the first 50% of pages b) every other page c) some other strategy

BOL is not clear on this.

Many thanks.

How does sampling work?

I have several massive tables. I'd like to ensure their statistics are up to date via a weekly maintenance plan.

However, doing so is taking too much time.

If I specify

WITH SAMPLE 50 PERCENT

does SQL Server then sample:

  1. the first 50% of pages
  2. every other page
  3. or some other strategy?

BOL is not clear on this.

Source Link
Nik
  • 409
  • 5
  • 12

Sql Server Statistics - how does sampling work?

I have (several) massive tables. I like to ensure their statistics are up to date via a weekly maintenance plan.

However, doing so is taking too much time.

If I specify

WITH SAMPLE 50 PERCENT

does Sql Server then sample

a) the first 50% of pages b) every other page c) some other strategy

BOL is not clear on this.

Many thanks.