DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Preset Options

max_index_keys

Shows the maximum number of index keys.

  • Default: 32
  • Type: integer
  • Range: 32 … 32
  • Applies: Read-only

In plain words

One index can cover at most 32 columns. That includes extra INCLUDE columns of a covering index. It is fixed when PostgreSQL is compiled.

For DBAs and operators

Defined by INDEX_MAX_KEYS (compile time). Error: ERROR: cannot use more than 32 columns in an index. If you are near this limit the index design is usually the problem: B-tree lookups only use leading columns efficiently, and wide indexes are expensive to maintain.

How to change it

Fixed when PostgreSQL was built or the cluster was initialised. You can only read it.

See it in context

B-tree indexes Index types

Related parameters

max_function_args max_identifier_length

All Preset Options parameters