June 18, 2014 at 4:51 am
Dear Experts,
It may be a silly question, please pardon me as I am a novice DBA, Is there a way to find out how many records a query would return without actually executing it? At first I thought this is possible via the 'display estimated execution plan' however I can't seem to get my head around the cost figures being displayed.
We use SQL Server 2008 standard
Thanks
Raj
June 18, 2014 at 5:41 am
No.
The estimated execution plan can give you the estimated number of rows, but that could be exactly correct, slightly wrong or several miles out depending on a large number of factors
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 18, 2014 at 6:20 am
Like Gail says, the only way to know exactly what a query will return is to run it. Even if the statistics were accurate 30 seconds ago, they may no longer be accurate because a row got inserted.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply