nerdexam
MongoDB

C100DBA · Question #42

What is the maximum size of Index Key Limit and Number of Indexes per collection?

The correct answer is A. 1024 bytes and 64 indexes. Option A is correct because MongoDB historically enforces a 1024-byte limit on index keys (the value being indexed) and allows a maximum of 64 indexes per collection, including the default _id index. Option B is wrong because 12 megabytes is wildly outside any index key…

Performance Tuning

Question

What is the maximum size of Index Key Limit and Number of Indexes per collection?

Options

  • A1024 bytes and 64 indexes
  • B12 mega bytes and 64 indexes
  • C64 bytes and 1024 indexes
  • D1024 bytes and unlimited indexes

How the community answered

(49 responses)
  • A
    94% (46)
  • B
    4% (2)
  • D
    2% (1)

Explanation

Option A is correct because MongoDB historically enforces a 1024-byte limit on index keys (the value being indexed) and allows a maximum of 64 indexes per collection, including the default _id index. Option B is wrong because 12 megabytes is wildly outside any index key constraint - that figure has no basis in MongoDB's indexing rules. Option C inverts the numbers - 64 bytes is far too small for a key limit, and 1024 indexes per collection has never been a MongoDB limit. Option D is wrong because MongoDB does cap indexes per collection at 64; unlimited indexes would cause significant write overhead and is not permitted.

Memory tip: Think "1024 and 64" as a shrinking power of two - 2¹⁰ bytes for the key size, 2⁶ indexes per collection. The bigger constraint (bytes) gets the bigger power.

Topics

#index key limit#indexes per collection#index constraints

Community Discussion

No community discussion yet for this question.

Full C100DBA Practice