Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 5123

Cardinality Estimation for >= and > for intra step statistics value

$
0
0

I am trying to understand how SQL Server try to estimate for greater than and greater than equal where clauses in SQL Server 2014.

I think I do understand the cardinality estimation when it hits the step for example, if i do

select * from charge where charge_dt >= '1999-10-13 10:47:38.550'

The cardinality estimation is 6672 which can be easily calculated as 32(EQ_ROWS) + 6624(RANGE_ROWS) + 16 (EQ_ROWS) = 6672 (histogram in below screenshot)

enter image description here

But as when i do select * from charge where charge_dt >= '1999-10-13 10:48:38.550' the estimate is 4844.13.

How is that calculated?



Viewing all articles
Browse latest Browse all 5123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>