The main reason why Microsoft introduced table variable in SQL Server 2000 is to reduce stored procedure recompilations (a recompilation occurs when the stored procedure execution plan is recreated). Table variables also have a well defined scope (the current procedure or function) and they induce less logging and locking (because their transaction last for a […]
Posts Tagged ‘set statistics profile’
September 13, 2011 by Francois · 2 Comments
Filed under: Performance, TSQL
Social Tagging: Index • indexes • OPTION (RECOMPILE) • query plan • set statistics profile • statistics • sub-optimal query plan • table variables • temp tables
Filed under: Performance, TSQL
Social Tagging: Index • indexes • OPTION (RECOMPILE) • query plan • set statistics profile • statistics • sub-optimal query plan • table variables • temp tables
July 15, 2011 by Francois · 1 Comment
Filed under: Performance
Social Tagging: local variable • OPTION (RECOMPILE) • plan cache • query plan • set statistics profile • statistics • sub-optimal query plan • TSQL • WITH RECOMPILE
Filed under: Performance
Social Tagging: local variable • OPTION (RECOMPILE) • plan cache • query plan • set statistics profile • statistics • sub-optimal query plan • TSQL • WITH RECOMPILE
A query plan is a set of steps generated by the database engine to retrieve data. Query plans are produced by the query optimizer from SQL statements. SQL Server automatically caches query plans and try to reuse them whenever possible. For many applications (such as OLTP transactional applications), plan reuse is a very good thing since […]
RSS