The finance screen shows the ten latest payments. There are a hundred and twenty thousand payments, and all of them are sorted for the sake of ten rows. Remove the sort from the plan.
SELECT * FROM payments ORDER BY created_at DESC LIMIT 10
You may only change the schema: indexes and ANALYZE. The query stays as the task wrote it — no need to send it back.
Grading runs on a larger dataset than the samples show — the answer has to hold at scale.
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in