beginner
Eighty-Seven Fast Queries
Read the evidence before you read the options. The signals are presented the way a dashboard would present them — nothing is labelled with the answer.
The report
The team lead noticed that the order history page takes about two seconds to load and asked someone to "look at the database". The database team reports that every query on that endpoint runs in single-digit milliseconds and there are no slow queries logged at all.
GET /orders/history — endpoint dashboardILLUSTRATIVE
| Signal | Value | What it tells you |
|---|---|---|
| p95 latency | 2.1 s | The page takes about two seconds at the tail. |
| App CPU | 17% | The application is not compute-constrained. |
| Slowest single query | 4 ms | No individual query is slow. |
| DB CPU | 38% | The database has spare capacity. |
| Queries per request | 88 average | Each page load issues eighty-eight separate queries. |
| Connection pool wait | 2 ms | Connections are available on demand. |
| Round-trip time to DB | 21 ms | Each query costs about twenty-one milliseconds in network time alone. |
One request, spans collapsed where identical
critical pathILLUSTRATIVE
0510102015302040
GET /orders/history2040 ms
auth.verify6 ms
SELECT * FROM orders WHERE user_id = $124 ms
SELECT * FROM order_items WHERE order_id = $1×871960 ms
serialize response40 ms
SELECT * FROM orders WHERE user_id = $1 — Returns 87 rows
SELECT * FROM order_items WHERE order_id = $1 — 87 sequential executions, ~22 ms each
What is the constraint?