I have the following query
select id from [dbo].[Posts] where id > 20797871 ( this is a stackoverflow database )


may I know why the estimation is 21499 .
The database is a Azure sql database with CL 150 .
I have the following query
select id from [dbo].[Posts] where id > 20797871 ( this is a stackoverflow database )


may I know why the estimation is 21499 .
The database is a Azure sql database with CL 150 .
This happens when statistics are outdated. You last updated statistics on March.
Please execute the following 2 statements.
ALTER INDEX ALL ON [Posts] REBUILD
GO
UPDATE STATISTICS [Posts] WITH FULLSCAN, COLUMNS
GO
Now execute the SELECT statement again, and include the actual execution time. All estimations should be ok.
no... I didn't touch any records .
strange , after flush the cache plan . it reflect a more accurate estimate stats.
but do you know the calculation of estimated row when using inequality predicate ?
7 people are following this question.