Generated SQL vs. Stored Procs

Posts   
 
    
ianvink
User
Posts: 394
Joined: 15-Dec-2006
# Posted on: 03-Jan-2007 00:51:37   

Are there any docs on how LLBL generated SQL can be as fast/er on average than procs due to the fact that gen'ed code is specific to the request and not general like procs?

Ian

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 03-Jan-2007 10:15:16   

Additionally, the SQL in a stored proc isn't stored in ready-to-use executable form, it still has to be converted to an execution plan at runtime, which is exactly the same as a dyn. parameterized query. (see sqlserver books online) The execution plan is cached for both, so if a similar statement comes along, the same execution plan is used.

i.o.w.: as soon as the dyn. parameterized query is loaded into the db it takes the same route as when the stored proc's sql is loaded into the db.

Frans Bouma | Lead developer LLBLGen Pro