Search code examples
sql-server-2005sql-execution-plan

SQL data execution plan


Does

SELECT TOP 1000 * FROM TABLE

return the same data execution plan as

SELECT * FROM TABLE?

Please also let me know if this should be moved to ServerFault.

Thanks.


Solution

  • You can check for yourself. In SSMS, go to Query -> Include Actual Execution Plan

    Then run your queries.

    e.g. when I run:

    SELECT TOP 10 * FROM sys.tables
    SELECT * FROM sys.tables
    

    They return different execution plans.