New answers tagged statistics
5
votes
Accepted
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 ...
3
votes
Accepted
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 ...
Top 50 recent answers are included
Related Tags
statistics × 374sql-server × 223
postgresql × 54
performance × 46
execution-plan × 40
sql-server-2014 × 35
optimization × 33
sql-server-2012 × 31
index × 29
sql-server-2016 × 29
oracle × 24
index-statistics × 23
sql-server-2008-r2 × 20
mysql × 19
query-performance × 18
cardinality-estimates × 18
sql-server-2008 × 14
sql-server-2005 × 11
azure-sql-database × 10
maintenance × 10
sql-server-2017 × 9
index-tuning × 9
ola-hallengren × 9
partitioning × 8
t-sql × 7