The order history endpoint exceeds its SLO after data growth. Database CPU is high, but only one query dominates the slow log.
Inspect the execution plan on the read replica before proposing an index.
Try: mysql -e 'EXPLAIN ANALYZE SELECT * FROM orders WHERE tenant_id=42 ORDER BY created_at DESC LIMIT 50;'
The query reads 50 rows instead of 12.4 million.
The composite index serves the equality filter and requested order without a filesort.
Lesson
Design indexes from observed access patterns, not individual columns. Put equality filters first, then ordering or range columns, verify with the real plan, and remember that every index adds write and storage cost.
Edit add_orders_tenant_created_index.sql
Create one index that matches the equality filter first and the requested order second.