1

While going through some MongoDB questions, I came across the following:

Point out the correct statement :

a) Whether the use of a compound index or the use of an index intersection is more efficient depends on the particular query and the system

b) Certain restrictions apply to indexes, such as the length of the index keys or the number of indexes per collection

c) For queries that specify compound query conditions, if one index can fulfill a part of a query condition, and another index can fulfill another part of the query condition, then MongoDB can use the intersection of the two indexes to fulfill the query

d) None of the mentioned

per my understanding of compound-index vs index-intersection, a) is the correct answer. However, the correct answer is marked as d)

Could anyone please explain why is d) the correct answer?

1
  • I'm curious, where did you see this question? Is this from an official MongoDB page? Commented Mar 27, 2018 at 2:53

1 Answer 1

1

Actually (d) is the only wrong answer in that question.

Point (a) is correct, as per Indexes - Index Intersection manual page where it states:

Whether the use of a compound index or the use of an index intersection is more efficient depends on the particular query and the system.

Point (b) is correct, as per Indexes - Restrictions manual page where it states:

Certain restrictions apply to indexes, such as the length of the index keys or the number of indexes per collection.

Point (c) is correct, as per Indexes - Index Intersection manual page where it states:

For queries that specify compound query conditions, if one index can fulfill a part of a query condition, and another index can fulfill another part of the query condition, then MongoDB can use the intersection of the two indexes to fulfill the query.

So points (a), (b), and (c) are all exact copies of the MongoDB documentation page.

I believe (d) should read "All of the above".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.