sql server - Entity Framework performance difference with many includes -
in application have big nasty query uses 25 includes. know might bit exessive, haven't given problems , have been working fine. if take query generated ef , run manually in database takes around 500ms, , code ef uses around 700ms data database , build object structure, , acceptable.
the problem on production server. if run query manually there see same around 500ms time usage fetch data, entity framework uses around 11000ms data , build object, , of course not measure.
so question is: can cause of these extreme differences when query fired manually on database same?
i ended using entity framework in more "manual" way.
so instead of using dbcontext.set<t> , lot of includes, had manually use series of dbcontext.database.sqlquery<t>("select something else"). after bit of painful coding binding objects tested on machines had problem, , worked expected on machines.
so don't know why worked on machines , not others, seems ef has problems on machine setups when there great deal of includes.
Comments
Post a Comment