исправил практику 'EXPLAIN и EXPLAIN ANALYZE'

This commit is contained in:
mnoskov
2026-03-15 17:23:18 +03:00
parent 50bb355a95
commit fec0f8e103
@@ -124,8 +124,8 @@ JOIN orders o ON u.id = o.user_id
JOIN order_items oi ON o.id = oi.order_id
JOIN products p ON oi.product_id = p.id
WHERE u.country = 'RU' AND p.category = 'Электроника';
-- Порядок чтения таблиц: order_items -> products -> orders -> users
-- Количество строк: order_items - 12, products - 3, orders - 1, users - 0
-- Порядок чтения таблиц: products -> order_items -> orders -> users
-- Количество строк: products - 3, order_items - 12, orders - 1, users - 0
-- Если у country и category будут индексы, то запрос ьудет выполняться побыстре, потому что будет Index Scan, а не Seq Scan