Commit fcbc2c73 authored by Toon Claes's avatar Toon Claes

Mention removal of redundant index when adding

When a new composite index is added, it might make an existing index
redundant.  So when adding an index, these redundant indexes should be
removed in the same migration.
parent b46a063f
......@@ -124,6 +124,8 @@ the following preparations into account.
- Follow the [guidelines on dropping columns](what_requires_downtime.md#dropping-columns).
- Generally it's best practice (but not a hard rule) to remove indexes and foreign keys in a post-deployment migration.
- Exceptions include removing indexes and foreign keys for small tables.
- If you're adding a composite index, another index might become redundant, so remove that in the same migration.
For example adding `index(column_A, column_B, column_C)` makes the indexes `index(column_A, column_B)` and `index(column_A)` redundant.
### How to review for database
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment