Hello I am creating a windows application that will be installed in 10 computers that will access the same database thru Entity Framework.
I was wondering what’s better:
- Spread the queries into packets (i.e. load contact then attach the included navigation properties – [DataContext.Contacts.Include(“Phone”]).
- Load everything in one query rather then splitting it out in individual queries.
- You name it.
BTW I have a query that its trace string produced over 500 lines of sql, im doubting, maybe i should waive user-exprience for performance since performance is also a part of u.e.
This will normally be superior. You’re usually better off writing chunkier queries than chatty ones. Fewer calls have less overhead – you need to obtain fewer connections, deal with less latency, etc..
Does the database server have to support other applications? For most business software applications, SQL server won’t even break a sweat servicing ten clients – particularly performing basic entity lookups. It won’t even really know you’re there unless it’s installed on a 486SX.