Проверка использования составного индекса
Условие задачи
В таблице public.carts есть составной индекс по полям (customer_id, country, sku). Проверить, будет ли он использоваться, если в SQL-запросе нет фильтрации по customer_id. Доп. условия: Индекс: (customer_id, country, sku) Фильтрации по customer_id в запросе нет.
goTable "public.carts"
+-------------+-----------------------------+-------------------------+
| Column | Type | Modifiers |
+-------------+-----------------------------+-------------------------+
| sku | bigint | not null |
| country | country_enum | not null |
| customer_id | bigint | not null |
| amount | bigint | not null |
| updated_at | timestamp without time zone | default now() not null |
+-------------+-----------------------------+-------------------------+
Table "public.customer"
+--------+--------+----------+
| Column | Type | Modifiers |
+--------+--------+----------+
| id | bigint | not null |
| email | text | not null |
+--------+--------+----------+