A redundant index is one where the indexed columns are covered by an another existing index, making the redundant index unnecessary.
For example, an index named
index_users_on_account_id with definition
CREATE INDEX index_users_on_account_id ON public.users USING btree (account_id) would be a redundant index of a more specific index named
index_users_on_account_id_and_created_at with definition
CREATE INDEX index_users_on_account_id_and_created_at ON public.users USING btree (account_id, created_at). In this example, the first index is unnecessary since queries containing an
account_id filter could use the second index.
Redundant indexes take up additional disk space and can slow down writes to the table, so it is recommended to remove them.
If a redundant index is detected, a recommendation will be created for the affected index. Take action to drop the index or ignore the recommendation to remove it from your recommendation dashboard.
Certain index attributes such as
UNIQUE or partial index constraints would exempt an index from being marked as redundant even if it shared the same indexed columns as another index.