Payments by Order Number
A reconciliation report needs to find rows in payments for each order by order_id; without help it scans payments again and again. Add an index on payments.order_id so payments for a specific order are found quickly.
Speed this query up with an index
SELECT * FROM orders o JOIN payments p ON p.order_id = o.id
Jen CREATE/ALTER/DROP — závěrečný SELECT není potřeba.
Přihlaste se, abyste viděli historii odevzdání
Přihlásit sePřihlaste se, abyste mohli použít AI mentora
Přihlásit se