In SQL Server 2005 management studio I am testing a query which uses some table variables, one of which has a clustered unique constraint on it. I am noticing that the total execution time actually goes down by a good amount when I include the actual execution plan to analyze it.
What is the reason for this, and should I only test for the total execution time when the option to include the execution plan is off.
Thanks!
Sounds a bit odd to me tbh. Are you sure that the difference you’re seeing is not down to caching?
I would always test the performance of a sproc by NOT including the execution plan, and I would clear the cache down before each run in order to have a fair comparison (on a test/dev db server, not production).