New answers tagged

5 votes

How does SQL estimate the number of rows in a less than < Predicate

for this query, SQL Server estimates 109,579 rows but I can't work out where it has got that from: RANGE_HI_KEY + RANGE_ROWS of all buckets up to and including RANGE_HI_KEY 470 = 109,566 so we are 11 ...
user avatar
  • 70.9k
3 votes

Why Does SQL Server not have 200 buckets in the statistics histogram when there are >100k distinct values in the table

The histogram in this case is nearly indistinguishable from prior to inserting the 4 duplicate values. At that time, the unique and sequential series could be completely described by three steps. The ...
user avatar
  • 1,343

Top 50 recent answers are included