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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Catalog and Routing
    • 2

    Description

      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.

      Attachments

        Activity

          People

            backlog-server-catalog-and-routing Backlog - Catalog and Routing
            james.lin@mongodb.com James Lin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: