diff options
author | Ian Boros <ian.boros@10gen.com> | 2018-07-02 18:44:05 -0400 |
---|---|---|
committer | Ian Boros <ian.boros@10gen.com> | 2018-08-23 15:03:55 -0400 |
commit | 0f3e3998dd3a7627de274795a1a27e79b4de4783 (patch) | |
tree | a06474e1cf38c5560ff7ced3b698ccda62a46160 /src/mongo/db/query/index_bounds.h | |
parent | 8c8dca466b256155b9f4d93858f432998cd6de12 (diff) | |
download | mongo-0f3e3998dd3a7627de274795a1a27e79b4de4783.tar.gz |
SERVER-34846 Forwardize IndexBounds before intersectizing their OILs
Diffstat (limited to 'src/mongo/db/query/index_bounds.h')
-rw-r--r-- | src/mongo/db/query/index_bounds.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mongo/db/query/index_bounds.h b/src/mongo/db/query/index_bounds.h index 2dfcc122b26..4b04f374b16 100644 --- a/src/mongo/db/query/index_bounds.h +++ b/src/mongo/db/query/index_bounds.h @@ -74,6 +74,15 @@ struct OrderedIntervalList { bool operator==(const OrderedIntervalList& other) const; bool operator!=(const OrderedIntervalList& other) const; + + void reverse(); + + /** + * Return a clone of this OIL, that is reversed. + */ + OrderedIntervalList reverseClone() const; + + Interval::Direction computeDirection() const; }; /** @@ -126,6 +135,11 @@ struct IndexBounds { static BoundInclusion makeBoundInclusionFromBoundBools(bool startKeyInclusive, bool endKeyInclusive); + /** + * Reverse the BoundInclusion. + */ + static BoundInclusion reverseBoundInclusion(BoundInclusion b); + /** * BSON format for explain. The format is an array of strings for each field. @@ -137,6 +151,12 @@ struct IndexBounds { */ BSONObj toBSON() const; + /** + * Return a copy of the index bounds, but with each of the OILs going in the ascending + * direction. + */ + IndexBounds forwardize() const; + // TODO: we use this for max/min scan. Consider migrating that. bool isSimpleRange; BSONObj startKey; |