Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds database indexes to improve query performance by targeting frequently queried columns that were previously unindexed. The migration specifically addresses the channelables table (adding indexes on enabled, channelable_type, channelable_id, starts_at, and ends_at) and soft delete columns on products and product_variants tables.
Key changes:
- Created a new migration to add indexes on multiple tables
- Implemented PostgreSQL-specific index creation to avoid compatibility issues with MySQL and SQLite
- Included rollback functionality to remove indexes if needed
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/core/database/migrations/2025_10_29_084000_add_missing_indexes_to_tables.php
Outdated
Show resolved
Hide resolved
packages/core/database/migrations/2025_10_29_084000_add_missing_indexes_to_tables.php
Show resolved
Hide resolved
|
@copilot @alecritson The 'channelable_type' & 'channelable_id' fields are generally queried together. Should we consider a composite index for them? |
|
@glennjacobs I've opened a new pull request, #2322, to work on those changes. Once the pull request is ready, I'll request review from you. |
That already exists |
|
@alecritson I've opened a new pull request, #2323, to work on those changes. Once the pull request is ready, I'll request review from you. |
…nar into add_missing_database_indexes
What's the purpose of adding individual indexes for them then? |
resolved |
PR to add some additional database indexes to help with query speed, most notably we had a few missing on the
channelablestable and thedeleted_atcolumns on products/variants.