SQL Server 2008 Compiled TSQL Performance -


what kinds of tsql select statements (i.e. starting select) benefited compiling , advantages provided by? compiling mean hosting select statements inside stored procedures.

i'm aware of other performance advantages of stored procs (encryption, separation of concerns etc.), i'm interested in performance aspect here.

here's example:

select t1.f1, t2.f2 t1 inner join t2 on t1.pk = t2.fk 

does/will above sql run faster when it's factored stored proc rather command text?

no, sql server optimizes , caches query plans based on query text @ statement level, generally, statement optimize same whether in stored procedure or not.

now, there other factors can affect how statement cached , optimized, , how stored procedure might exhibit different performance characteristics (and use different plan) same query outside of stored procedure. example: set settings. beyond scope of core question, erland's article, slow in application, fast in ssms? understanding performance mysteries fantastic , enlightening read.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -