Sample Header Ad - 728x90

Is MongoDB secondary index size affected by primary key size?

2 votes
1 answer
620 views
If I understand correctly, secondary index leaf nodes in MySQL InnoDB engine hold the table primary key value (at least for a unique index). Thus, looking up a value in the secondary index results in two BTREE lookups: one for the secondary index and another one for the clustered index (clustered on the primary key). This also means that the primary key size affects the size of all secondary indexes. *Is this how MongoDB WiredTiger secondary indexes work too?* Or do MongoDB secondary indexes store a reference to the physical block where the document resides? (I believe this is how Postgres handles indexes)
Asked by nimrodm (165 rep)
May 29, 2019, 08:13 PM
Last activity: May 31, 2019, 02:55 AM