Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-80410

Improve "Index key pattern too large" error message when more than 32 fields used in creating a compound index

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • CAR Team 2024-10-28, CAR Team 2024-11-11
    • 2

      In most recent MongoDB releases (e.g. 5.0+), "Index key pattern too large" error message will be received if there are more than 32 fields when creating a compound index. This is due to documented limit in Number of Indexed-Fields in a Compound Index.
       
      For example, if running the createIndex command from createindex-toolarge.nosql file, it will fail with an error message "...caused by :: Index key pattern too large".

      The error message is not obvious to a user who run the create index command what goes wrong and often the user will mistakenly think the other limit 1024 byte index limit which has been resolved since 4.2. This can cause confusion.

      We can improve the error message to be more direct and explicit, like "caused by :: Index keys (fields) exceeded the limit (32) for the number of indexed fields" or something similar.

            Assignee:
            igor.praznik@mongodb.com Igor Praznik
            Reporter:
            james.lin@mongodb.com James Lin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: