diff options
Diffstat (limited to 'src/mongo/db/query/query_planner_common.h')
-rw-r--r-- | src/mongo/db/query/query_planner_common.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mongo/db/query/query_planner_common.h b/src/mongo/db/query/query_planner_common.h index 3c3bb88936c..6d441155b54 100644 --- a/src/mongo/db/query/query_planner_common.h +++ b/src/mongo/db/query/query_planner_common.h @@ -79,10 +79,17 @@ public: } /** + * Traverses the tree rooted at 'node'. Tests scan directions recursively to see if they are + * equal to the given direction argument. Returns true if they are and false otherwise. + */ + static bool scanDirectionsEqual(QuerySolutionNode* node, int direction); + + /** * Traverses the tree rooted at 'node'. For every STAGE_IXSCAN encountered, reverse - * the scan direction and index bounds. + * the scan direction and index bounds, unless reverseCollScans equals true, in which case + * STAGE_COLLSCAN is reversed as well. */ - static void reverseScans(QuerySolutionNode* node); + static void reverseScans(QuerySolutionNode* node, bool reverseCollScans = false); /** * Extracts all field names for the sortKey meta-projection and stores them in the returned |