|
|
|
|
|
by nevinera
4993 days ago
|
|
>Range queries are indexed differently If I'm reading your description right, this is hardly mongo-specific. Try it in mysql, for example: (index is [:last, :first]) select first from names
where last in ('gordon','holmes','watson')
order by first;
An index is an ordering by which a search may be performed -
to illustrate, the index for my small table looks pretty much like this: gordon, jeff
holmes, mycroft
holmes, sherlock
watson, john
Unless the first key is restricted to a single value, it can't order by the second key without performing at least a merge-sort. They aren't in that order in the index. |
|