3 ms·
>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, :
by nevinera 14y 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.
- foobar2k 14y agoHe never said it was mongo specific
- nevinera 14y ago>Things I wish I knew about MongoDB a year ago The post reads as a series of criticisms about mongo. I don't love mongo, but I'm not aware of any data store that can perform that type of query purely from an index. Now, the description was vague enough that he could have been describing a real bug I'm not aware of - at one point I've seen MySQL decide to use an index for sorting instead of for filtering when that query plan was 500x slower. If mongo has a bug like that one, disregard my comment please. :-)