Query time 0.00825
JSON explain
{
"query_block": {
"select_id": 1,
"filesort": {
"sort_key": "descr1.product, products.product_id",
"temporary_table": {
"filesort": {
"sort_key": "case when products.parent_product_id <> 0 then products.parent_product_id else products.product_id end",
"temporary_table": {
"table": {
"table_name": "master_products_storefront_offers_count",
"access_type": "system",
"possible_keys": ["PRIMARY", "idx_storefront_id"],
"rows": 0,
"filtered": 0,
"const_row_not_found": true
},
"table": {
"table_name": "cscart_categories",
"access_type": "range",
"possible_keys": ["PRIMARY", "c_status", "p_category_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"rows": 7,
"filtered": 100,
"index_condition": "cscart_categories.category_id in (880,881,882,883,884,885,886)",
"attached_condition": "(cscart_categories.usergroup_ids = '' or find_in_set(0,cscart_categories.usergroup_ids) or find_in_set(1,cscart_categories.usergroup_ids)) and cscart_categories.`status` in ('A','H') and cscart_categories.storefront_id in (0,1)"
},
"table": {
"table_name": "products_categories",
"access_type": "ref",
"possible_keys": ["PRIMARY", "pt"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"ref": ["admin_test.cscart_categories.category_id"],
"rows": 13,
"filtered": 100,
"using_index": true
},
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "status", "idx_master_product_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["admin_test.products_categories.product_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "products.master_product_id = 0 and (products.usergroup_ids = '' or find_in_set(0,products.usergroup_ids) or find_in_set(1,products.usergroup_ids)) and products.`status` = 'A' and products.master_product_status = 'A' and products.company_id > 0 and products.product_type <> 'D'"
},
"table": {
"table_name": "war_sum_amount",
"access_type": "ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["admin_test.products_categories.product_id"],
"rows": 1,
"filtered": 100,
"using_index": true
},
"table": {
"table_name": "descr1",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "product_id"],
"key": "PRIMARY",
"key_length": "9",
"used_key_parts": ["product_id", "lang_code"],
"ref": ["admin_test.products_categories.product_id", "const"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(descr1.lang_code = 'ru')"
},
"table": {
"table_name": "prices",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"lower_limit",
"usergroup_id"
],
"key": "usergroup",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["admin_test.products_categories.product_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "prices.lower_limit = 1 and prices.usergroup_id in (0,0,1)",
"using_index": true
},
"table": {
"table_name": "companies",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["company_id"],
"ref": ["admin_test.products.company_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(companies.`status` = 'A' or products.company_id = 0)"
},
"table": {
"table_name": "warehouses_destination_products_amount",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "idx_storefront_id"],
"key": "PRIMARY",
"key_length": "9",
"used_key_parts": ["product_id", "destination_id", "storefront_id"],
"ref": [
"admin_test.products_categories.product_id",
"const",
"const"
],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond((case products.is_stock_split_by_warehouses when 'Y' then warehouses_destination_products_amount.amount else products.amount end) > 0 or products.tracking = 'D')"
}
}
}
}
}
}
}
Result
product_id |
product |
company_name |
product_ids |
product_types |
parent_product_ids |
product_type |
parent_product_id |
master_product_offers_count |
master_product_id |
company_id |
21088 |
Чехол LUXO Carbon для AirPods 3 (Black-Gray) |
Точка Связи |
21088 |
P |
0 |
P |
0 |
0 |
0 |
9 |
20980 |
Чехол LUXO Carbon для AirPods 3 (Black-Red) |
Точка Связи |
20980 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21071 |
Чехол LUXO Carbon для AirPods 3 (Blue) |
Точка Связи |
21071 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21074 |
Чехол LUXO Carbon для AirPods 3 (Green) |
Точка Связи |
21074 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21072 |
Чехол LUXO Carbon для AirPods 3 (Red) |
Точка Связи |
21072 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21073 |
Чехол LUXO Carbon для AirPods 3 (Sierra Blue) |
Точка Связи |
21073 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21076 |
Чехол LUXO Carbon для AirPods Pro (Black-Gray) |
Точка Связи |
21076 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21119 |
Чехол LUXO Carbon для AirPods Pro (Blue-Purple) |
Точка Связи |
21119 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21166 |
Чехол LUXO Carbon для AirPods Pro (Sierra Blue) |
Точка Связи |
21166 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21116 |
Чехол LUXO для AirPods 2 (Mix) |
Точка Связи |
21116 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21117 |
Чехол LUXO для AirPods 3 (Mix) |
Точка Связи |
21117 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21118 |
Чехол LUXO для AirPods Pro (Mix) |
Точка Связи |
21118 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21087 |
Чехол uBear AirPods Pro Touch Pro Silicone Case (Зеленый) |
Точка Связи |
21087 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21120 |
Чехол для AirPods 0.1mm (Mix) |
Точка Связи |
21120 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21096 |
Чехол для AirPods 2 Soft Series Mix |
Точка Связи |
21096 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21113 |
Чехол для AirPods 3 0.1mm (Mix) |
Точка Связи |
21113 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21097 |
Чехол для AirPods 3 Soft Series Mix |
Точка Связи |
21097 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21114 |
Чехол для AirPods Mix |
Точка Связи |
21114 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21105 |
Чехол для AirPods Pro 2 0.1mm (Mix) |
Точка Связи |
21105 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21108 |
Чехол для AirPods PRO Кожа Мозайка Mix |
Точка Связи |
21108 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21106 |
Чехол для AirPods Pro Тематические (Carton) Mix |
Точка Связи |
21106 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21098 |
Чехол для AirPods Кожа Multicolor |
Точка Связи |
21098 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21110 |
Чехол для AirPods Кожа Камуфляж Mix |
Точка Связи |
21110 |
P |
0 |
P |
0 |
0 |
0 |
9 |
21111 |
Чехол для AirPods Кожа Мозайка Mix |
Точка Связи |
21111 |
P |
0 |
P |
0 |
0 |
0 |
9 |