Performance problem when projecting results

Posts   
 
    
MarcoP avatar
MarcoP
User
Posts: 270
Joined: 29-Sep-2004
# Posted on: 06-Jan-2011 19:45:06   

** MOVED TO THE BUG SECTION **

http://llblgen.com/tinyforum/Messages.aspx?ThreadID=19224

I've noticed a big performance penalty when using Linq and Projecting the results to an object. Basically, it looks like the query engine performs an inner select, for example:


select ... from (select ...) order by id limit 1, 25

JUST NOTICED Shoudln't the order by limit go into the inner select??

What runs in query analyzer in 43ms (select column, etc from table) takes 13 seconds with a projection. Am I doing something wrong or how can i get around this? When I look at the execution plan the big difference is the "sending data" phase.

The tables I am using are huge denormalized tables (500K - 7million rows), so performance is key. My whole data tier is build around linq, so i would hate to not use it. Would it be faster to fetch entity collections? what would be the fastest fetch routine to use (typed view, open reader, untyped list, etc.)?? Also, I am using paging to help with performance.

Thanks