Skip to content

Conversation

@NikolayS
Copy link

Addresses postgres.ai issue 019b3336-fb12-7072-b792-3233ffbcd699.

Based on 36 days of index usage statistics, these indexes were never used:

  • Product: 4 explicit + 1 auto-generated _like index
  • Customer: 2 explicit + 1 auto-generated _like index
  • Order: 5 explicit + 1 FK index
  • OrderItem: 3 explicit + 2 FK indexes
  • Non-Django tables (orders, order_items, order_item_events, payments): 12 indexes

All DROP operations use CONCURRENTLY to avoid blocking writes. Reverse migration included for rollback with CREATE INDEX CONCURRENTLY.

Addresses postgres.ai issue 019b3336-fb12-7072-b792-3233ffbcd699.

Based on 36 days of index usage statistics, these indexes were never used:
- Product: 4 explicit + 1 auto-generated _like index
- Customer: 2 explicit + 1 auto-generated _like index
- Order: 5 explicit + 1 FK index
- OrderItem: 3 explicit + 2 FK indexes
- Non-Django tables (orders, order_items, order_item_events, payments): 12 indexes

All DROP operations use CONCURRENTLY to avoid blocking writes.
Reverse migration included for rollback with CREATE INDEX CONCURRENTLY.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants