Why is Entity Framework so slow with join statements? -


i have ef 6 query has 6 linq join statements in it. when step through code debugger, can see query statement takes 6 seconds run. sql trace, can tell actual query, looks expect to, takes 0 ms , returns 0 rows. removed join statements 1 one. each join statement removed, ef statement took 1 second less execute. select portion of query never changed, number of joins.

my question is, happening? ef doing requires time process query? oddly, looks of time spent after sql execution finished, time not generating query, whatever ef doing afterward.

are utilizing lazy-loading , initializing each join individually? if calling 6 joins on 6 large data sets returning decently sized objects, slow. taking long time because data-set returning might large , doing 6 times. i've had problem huge data-sets , tables on web pages filter ajax. able improve performance lot utilizing lazy-loading , building quires , initializing once. i'm guessing after 6 joins want 1 dataset comprised of joins. want build joins 1 single query , have fire against db once ef has build objects code once.


Comments