A query filters orders by customer_id and sorts by created_at descending. What index might help and how do we verify?
A composite index on (customer_id, created_at DESC) is a candidate. Verify with EXPLAIN ANALYZE using representative customer sizes and the real LIMIT. Compare execution time, rows scanned and write overhead before retaining the index. Avoid adding it solely from the query text; existing indexes and data distribution may change the result.
