Tuesday, April 3, 2018

For repeatability, TableSample with Repeatable option with a repeat-seed is better

TableSample returns approximately the rows specified with random values for each of physical 8KB page in a table. The returned rows are variable from zero to a value even higher than specified rows or % of rows. It all depends on how evenly data is distributed on the pages.


TableSampleRepeat_0

The REPEATBALE option results in selected sample returned gain. The repeat_seed must be an integer greater then 0.

With Repeatable option specified with the same repeat_seed value, SQL Server will typically returns the same subset of rows as long as no changes have been made to table.

With repeatable(10) option

10 rows out of 209 row is shown in the above.
With REPEATABLE option, the same rows are returned again and again for each run.




No comments:

Post a Comment

I am not paying this invoice. I am disregarding it, becuase....

 I am not paying this invoice because MICROSOFT has not provided me with a satisfactory way to access my account since June of this year des...