37048-vm/db/migrations/014_add_indexes_to_orders.sql
2025-12-04 21:21:10 +00:00

8 lines
361 B
SQL

-- Add indexes to the orders table to improve query performance for the dashboard
-- Index for the status column, as it's frequently used in WHERE clauses
ALTER TABLE `orders` ADD INDEX `idx_status` (`status`);
-- Index for the order date column, as it's used for grouping and filtering by date
ALTER TABLE `orders` ADD INDEX `idx_created_at` (`created_at`);