Skip to content

index-elements-more-than-three (GN005)#

Automatic fix is not available.

What it does#

Checks for indexes with more than three elements.

Why not?#

From the documentation:

Multicolumn indexes should be used sparingly. In most situations, an index on a single column is sufficient and saves space and time. Indexes with more than three columns are unlikely to be helpful unless the usage of the table is extremely stylized.

When should you?#

If you really need to.

See indexes-bitmap-scans for some discussion of the merits of different index configurations.

Use instead:#

Keep your index elements at most three.