Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
If I want to retrieve a list of data and display it by using EF code first (http://msdn.microsoft.com/en-in/data/dn468673[^]) or stored procedure (http://msdn.microsoft.com/en-us/data/jj592907.aspx[^]), which of them has the shortest time to retrieve it?
Posted
Updated 27-Dec-14 10:02am
v2
Comments
PIEBALDconsult 27-Dec-14 16:07pm    
They're not mutually exclusive; and if speed is important I'd use neither.

1 solution

Without knowing your intentions, as I see, you try to compare things that should not be compared.
One can say, EF Code First is quite efficient (see: http://msdn.microsoft.com/en-us/data/hh949853.aspx[^]), but far not as efficient as writting SQL query directly. Still, if you speak about stored procedure, you are probably not simply wrapping a simple query in a stored procedure - you would add some logic. At this point you might well gain by using EF and running that logic in managed code instead of using fancy trick in t-sql. But you have to have the tier running that logic as close to the datastore as you can get (running on the same machine).

Still, if you need advanced logic and most performance, you should consider making use of the CLR integrated features, like the CLR stored procedure[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900