I have sql server 2005 database. When I execute a query for the first time it takes much time to return the result, but subsequent queries execute quicker.
Why is this happening?
I have sql server 2005 database. When I execute a query for the first time it takes much time to return the result, but subsequent queries execute quicker.
Why is this happening?
Because sql server stores query execution plan for it when it runs first time ..so in second time and third time it use same query plan which actully save time and return quick resule..
Because It creates execution plan when you run it first time and second or next time it just verify the execution plan and do not take time to create execution plan. That's why it gives result in quick time.