MySQL · Query & indexing · L1
← Query performance across the stack
A hot endpoint does a full table scan on orders because there's no composite index for its filter and sort.
One endpoint is slow under load while the rest of the app is fine. EXPLAIN shows type: ALL (full scan) and a large rows estimate on the orders table.
The query filters by tenant_id and status and sorts by created_at, but no single index covers that combination, so MySQL scans the whole table and sorts in memory or on disk.
Seed a multi-tenant orders table of several million rows and an endpoint filtering by tenant_id/status ordered by created_at, with the composite index removed.
Prototype — scenario content is a preview; the live sandbox is not wired up.