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

Do you know what you installed while custom installing SQL Server 2022?

 When you install any software in Windows OS, the key information gets into the Registry and some of which you can look up in the control pa...