locked
Paging performance with Skip/Take

    Question

  •  

    Hi,

    my question is - what is the performance characteristics of Linq to SQL using skip and take for paging?

    It looks like the generated SQL selects everything and the actual paging is done in code, which seems to be a little questionable when you've got many many rows. Is it advised to use skip/take only for smaller tables and use stored procs for large tables or will it handle large tables ok as well?

     

    thanks

    Florian

     

    Friday, December 14, 2007 8:36 PM

Answers

  • >It looks like the generated SQL selects everything and the actual paging is done in code

     

    If the database isn't doing tops for the paging, something is wrong with your query.

     

     

    In my company, LINQ skip and take (generating top in SQL) was 1000's of times faster than our custom paging solution.

     

    Friday, December 14, 2007 9:08 PM

All replies

  • >It looks like the generated SQL selects everything and the actual paging is done in code

     

    If the database isn't doing tops for the paging, something is wrong with your query.

     

     

    In my company, LINQ skip and take (generating top in SQL) was 1000's of times faster than our custom paging solution.

     

    Friday, December 14, 2007 9:08 PM
  • yep, you're right. awesome!

     

    Friday, December 14, 2007 11:12 PM