A multi-column index on column_1, column_2, ..., column_n can replace individual indexes on column_1, column_1, column_2, etc. Use this detector to find redundant indexes.
Workflow:
- List extraneous indexes:
bundle exec rake active_record_doctor:extraneous_indexes
- Manually confirm each index can be safely dropped.
- Create a migration to drop the indexes.
Note: Unique indexes are never suggested for removal if they could be replaced by a non-unique index, as this would violate uniqueness constraints. Extra indexes on primary keys are also reported.
Supported configuration options:
enabled (boolean): Set to false to disable the detector.ignore_tables (list): Tables whose indexes should never be reported.ignore_indexes (list): Specific indexes that should never be reported.
bundle exec rake active_record_doctor:extraneous_indexes