Structure of the _id and document storage in mongodb

24 views
Skip to first unread message

Moditha Hewasinghage

unread,
May 3, 2018, 10:17:56 AM5/3/18
to mongodb-dev
Hi,

Can anyone direct me to the correct path where I can find the exact structure of how the index for _id is maintained, blocks allocated and the data stored? I was trying to insert simple documents ({a:1,b:2}) with default _id creation. When I check the stats of the data it says document size is 44b and the storage size is16384 (using wired tiger without compression to get better idea). It says 3 blocks are allocated (block size 4KB) so I'm not sure what the other block is being used for (16384/4096=4). Moreover, when inserting the same sized documents at the 4th document (data is 176b), the storage expands to 7 blocks. If someone could help me with how exactly the data is stored it would be really helpful or where to find it in the source code.

Thank you,
Moditha
Reply all
Reply to author
Forward
0 new messages