According to the MongoDB documentation (at least this blog entry https://www.mongodb.com/blog/post/new-compression-options-mongodb-30), prefix compression is enabled by default on MongoDB.

However, when I look at one collection, I see this:

    "wiredTiger" : {
        "metadata" : {
            "formatVersion" : 1
        "creationString" : "...,prefix_compression=0,prefix_compression_min=4"

Does prefix_compression=0 means that my indexes are not prefix-compressed ?

  • thank you for asking this question! I wondered the same
    – asgs
    Commented Aug 10, 2022 at 14:36

1 Answer 1


By default collection stats only include information on the collection data (which uses block-level compression rather than prefix compression).

To see index details you need to provide an additional indexDetails option, eg:


You should see "prefix_compression=true" in the index creationString value.

  • thank you so much! I was confused like the OP was
    – asgs
    Commented Aug 10, 2022 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.