Где продавался этот товар
Где продавался этот товар
Менеджер по закупкам смотрит, в какие заказы попадал товар. Позиций в базе четверть миллиона, по этому товару — сотня. Уберите полный проход по позициям заказов.
Speed this query up with an index
SELECT * FROM order_items WHERE product_id = 777
Apenas CREATE/ALTER/DROP — não é preciso um SELECT no final.
What counts as solved
You may only change the schema: indexes and ANALYZE. The query stays as the task wrote it — no need to send it back.
- the plan has no Seq Scan on order_items
- the query reads at most 18 8 KB pages
Grading runs on a larger dataset than the samples show — the answer has to hold at scale.
Entre para ver seu histórico de envios
EntrarEntre para usar o AI Mentor
EntrarFocus radio
Paused · SomaFM · Fluid