Created
March 16, 2026 20:51
-
-
Save cphillips83/e94a17085a1c477480afbd217fe33437 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Fix: add missing index on orders.status for active order queries | |
| -- Author: DBA Team | |
| -- Date: 2026-03-16 | |
| BEGIN; | |
| CREATE INDEX CONCURRENTLY idx_orders_status | |
| ON orders(status) | |
| WHERE status != 'completed'; | |
| -- Verify | |
| SELECT indexname, indexdef | |
| FROM pg_indexes | |
| WHERE tablename = 'orders' AND indexname = 'idx_orders_status'; | |
| COMMIT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment