March 2019
Intermediate to advanced
394 pages
11h 4m
English
Index intersection refers to the concept of using more than one index to fulfill a query. This was added fairly recently, and is not perfect yet; however we can exploit it to consolidate our indexes.
Index intersection can happen when we use OR ($or) queries, by using a different index for each OR clause. Index intersection can happen when we use AND queries, and we have either complete indexes for each AND clause or index prefixes for some (or all) of the clauses.
For example, consider a query on our books collection, as follows:
> db.books.find({ "isbn":"101", ...Read now
Unlock full access