One result row can hide a large scan.
The endpoint returns one JSON object: a count and a total for a day. The response is tiny, so the database work must be tiny too.
THE READING ROOM
THE READING ROOM
The endpoint returns one JSON object: a count and a total for a day. The response is tiny, so the database work must be tiny too.
The query asks for documents whose region is two. Without an index on that property, the system may inspect every document. With an appropriate indexed projection, it can navigate to a much smaller candidate set.