Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is MongoDB WiredTiger using clustered index?

Is WiredTiger using clustered index on _id or just non-clustered index when it is as the storage engine of MongoDB? Is there any way to manage it?

like image 791
Vincent More Avatar asked Jan 24 '26 03:01

Vincent More


1 Answers

As of MongoDB 4.0.6, WiredTiger does not use clustered index for the _id field.

Actually there is no facility to create clustered index in MongoDB using WiredTiger currently.

See SERVER-3294 for the discussion regarding adding this feature to MongoDB.

EDIT: As Arjun mentioned in the other answer, it is possible to create a clustered index from MongoDB 5.3 (thanks Arjun!). However it comes with a set of limitations: https://www.mongodb.com/docs/v5.3/core/clustered-collections/#limitations but it also comes with certain advantages as well. So if you're thinking about using this feature, please do test it extensively before deploying it in production.

like image 190
kevinadi Avatar answered Jan 26 '26 19:01

kevinadi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!