[DOCS-2918] Re-word index key size description Created: 15/Mar/14  Updated: 18/Mar/14  Resolved: 18/Mar/14

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: v1.3.2

Type: Improvement Priority: Major - P3
Reporter: Daniel Pasette (Inactive) Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: sprint-slipstream
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 9 years, 48 weeks, 1 day ago

 Description   

http://docs.mongodb.org/master/reference/limits/#Index Key

I recently learned that the v1 index key size is only stored as bson when the string length is > 255. Let's figure out a way to make this description helpful without digging too far into the weeds of what the size is...

The total size of an index key entry must be less than 1024 bytes. The total size includes the following overhead:
 
5 bytes for the BSON document structure,
1 byte for type specification for each field in the index key,
any additional representation overhead for each field in the index key.
For example, a string has a representation overhead of 5 bytes: 1 byte for the null terminator plus the 4 bytes to specify the length of the string including the terminator. Then, for an index on a string field, the indexed field value must be less than 1013 bytes. For a compound index on two string fields, because each field adds 6 bytes of overhead (1 for type specification and 5 for representation) as well as the 5 bytes for the BSON document structure, the key size must be less than 1007.



 Comments   
Comment by Githook User [ 18/Mar/14 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-2918 index key limit
Branch: master
https://github.com/mongodb/docs/commit/ec500106d104fb45369033d8814678b6a99ca543

Generated at Thu Feb 08 07:44:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.