[SERVER-1673] Allow distinct to use indexes Created: 24/Aug/10 Updated: 17/May/17 Resolved: 14/Nov/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance, Querying |
| Affects Version/s: | 1.6.1 |
| Fix Version/s: | 1.7.3 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kevin McCarthy | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 9 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
db.ensureIndex( {x:1}) db.distinct('x') Distinct apparently does a full table scan, even though it could use the index to speed things up a bit. Please see the discussion here: http://groups.google.com/group/mongodb-user/browse_thread/thread/912fd4b9e303fb04/ My current application of MongoDB relies on fast distincts, and I think this would help quite a bit. |
| Comments |
| Comment by auto [ 14/Nov/10 ] |
|
Author: {'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}Message: disinct can pull data from indexes and will choose an index to use if sensible |
| Comment by auto [ 14/Nov/10 ] |
|
Author: {'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}Message: if key is in index, use it for distinct |
| Comment by auto [ 14/Nov/10 ] |
|
Author: {'login': 'erh', 'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}Message: prep work for distinct w/indexes |