The 'orders of the day' query reads the whole table
OPS-1182: "Orders of the day" page is slow
Reported by: Callum Reyes (Support lead, Moss Wholesale) · Priority: Medium · Component: Back office
Symptom
Opening "Orders of the day" in the back office takes about 2 seconds, and a few seconds more when several of us use it at once. In spring it was instant. The slow part is the one query behind the page (plan from production attached).
Steps to reproduce
Run the orders-for-a-day query for any recent date. The sample data is tiny, so look at the work the query does (the production plan shows what it looked like on the real table) rather than its time.
Expected
The page returns one day's orders in well under 100 ms on the production table, reading only the part of the table for that day. The rows must stay the same.
Actual
About 1.8 s per call; the plan scans the whole table.
© AICodingRound. Ticket text for practice on this site; see Terms.
How it works
- 1Fix the problemin a real codebase.
- 2Use your ownAI, or none.
- 3Submit, then answera few short questions.
- 4Get your gradeand feedback.