-- Performance indexes for orders list view
-- Covers: source filter, external_status_id filter/sort, ordered_at sort,
-- composite source+external_status_id for combined filtering
ALTER TABLE orders
    ADD INDEX IF NOT EXISTS orders_source_idx (source),
    ADD INDEX IF NOT EXISTS orders_external_status_idx (external_status_id),
    ADD INDEX IF NOT EXISTS orders_ordered_at_idx (ordered_at),
    ADD INDEX IF NOT EXISTS orders_source_status_idx (source, external_status_id);
