[SERVER-3227] space used for index depends on fields fullnames legnth Created: 09/Jun/11 Updated: 29/Aug/11 Resolved: 09/Jun/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance |
| Affects Version/s: | 1.8.0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Yan | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | indexing | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
Even if using non-compound indexes, indexes on 1 field = seems like every index entry stores full names of fields. In our test cases field names if very long and deep (many levels of supobjects). I think index may have name, ONE fields desription, order, and many entries with ONLY values, or values + field position. More space index occupy - less total objects count fits in RAM (even big RAM). Compact indexes - happy customers. |
| Comments |
| Comment by Yan [ 09/Jun/11 ] |
|
Thank you very much. >for (i = 0; i < 700000; i++) {db.small.save( {"x" : i})}; )}; }}}}}}}})}; > db.small.ensureIndex( {x : 1}); ); ); > db.small.stats() , , , |
| Comment by Eliot Horowitz (Inactive) [ 09/Jun/11 ] |
|
Field names are not stored in indexes for normal indexes. If you have a doc like { "a" : 1 , "b" : 2 , "c" : { "x" : 3 } } An index on |