it appears we are taking one too many round trips to do when pre-fetching children. This can be very expensive as the tree gets wider the deeper we go. For example, in courseware we want depth=2 (course, chapter, sequential). But looking at log output we were also getting verticals, which there can be a lot of. This should cut down on the total data we are grabbing from the DB.
This commit is contained in:
@@ -366,6 +366,9 @@ class MongoModuleStore(ModuleStoreBase):
|
||||
children.extend(item.get('definition', {}).get('children', []))
|
||||
data[Location(item['location'])] = item
|
||||
|
||||
if depth == 0:
|
||||
break;
|
||||
|
||||
# Load all children by id. See
|
||||
# http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24or
|
||||
# for or-query syntax
|
||||
|
||||
Reference in New Issue
Block a user