locked
Which is Best Performance in Query Execution..? based on SQL and Linq ( Entity Framework 5.0) RRS feed

  • Question

  • User1970566204 posted

    Which is Best Performance in Query Execution..? based on SQL and Linq ( Entity Framework 5.0)

    Database = SQL Server 2008.

    I have multiple columns ( around 35 ) in a single table. 
    If suppose i need 5 columns from that table , i write the query as

    *****************************

     Scenario 1
    select <<column1>>,<<column10>>,<<column18>>,<<column23>>,<<column35>> from <<SingleTable>> where <<somefilter>>

    *****************************

     Scenario 2
    I do normalization for that <<SingleTable>>, into 5 tables as <<Table1>>,<<Table2>>,<<Table3>>,<<Table4>>,,<<Table5>>
    If suppose i need 5 columns from those tables , i write the query as

    select <<t1.column1>>,<<t2.column10>>,<<t3.column18>>,<<t4.column23>>,<<t5.column35>>
    from t1 
    <<join>> t2 on t1.commonid=t2.commonid 
    <<join>> t3 on t1.commonid=t3.commonid 
    <<join>> t4 on t1.commonid=t4.commonid 
    <<join>> t5 on t1.commonid=t5.commonid 
    where <<somefilter>>

    Questions:

    1. Which one produce best Performance via SQL Stored Procedures, and 
    2. Which one Produce best performance via Linq to Entities

     

    Tuesday, November 3, 2015 9:22 AM

Answers

All replies