asp.net - How to prevent Orchard projections from firing hundreds of queries -


i have following problem projections module in orchard:
have pages main categories when opened query database (not orchard one, coming separate application) it's subcategories , items in subcategories.

i have projection shows main category titles in widget easy navigation. page load times skyrocket because in projection tries load each main category whole resulting in exponential amount of queries against our second database , loading times in excess of 30 seconds.

is possible projections module query title part (and perhaps custom bindings) , ignore part executes queries?

thanks in advance.

edit

we used mini profiler , result:
mini-profiler output

it seems problem in display method of orchard.projections.drivers.projectionpartdriver on line 111:

var contentitems = _projectionmanager.getcontentitems(query.id, pager.getstartindex() +     part.record.skip, pager.pagesize).tolist(); 

what can it?

i think n+1 query issue caused fact parts' records lazily loaded, it's 1 subsequent query each fetched item each accessed part.

with contentquery there queryhints eagerly load part records ihqlquery (the query used in projector filters) use join() method join in (= eagerly load) tables. needs write code: creating projector filter provider joins in tables, use filter respective queries.

i don't know of simpler option eager loading projector it's worth exploring. why don't open issue this?


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -