Query time 0.01072
JSON explain
{
"query_block": {
"select_id": 1,
"cost": 0.094022898,
"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": {
"nested_loop": [
{
"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": "tmall_categories",
"access_type": "range",
"possible_keys": ["PRIMARY", "c_status", "p_category_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"loops": 1,
"rows": 5,
"cost": 0.009400072,
"filtered": 100,
"index_condition": "tmall_categories.category_id in (223,224,225,226,227)",
"attached_condition": "(tmall_categories.usergroup_ids = '' or find_in_set(0,tmall_categories.usergroup_ids) or find_in_set(1,tmall_categories.usergroup_ids)) and tmall_categories.`status` in ('A','H') and tmall_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": ["tmall.tmall_categories.category_id"],
"loops": 5,
"rows": 2,
"cost": 0.00483621,
"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": ["tmall.products_categories.product_id"],
"loops": 13.6,
"rows": 1,
"cost": 0.023719554,
"filtered": 93.27916718,
"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 in ('A','H') and products.company_id > 0"
}
},
{
"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": ["tmall.products_categories.product_id", "const"],
"loops": 12.68596624,
"rows": 1,
"cost": 0.022343965,
"filtered": 100,
"attached_condition": "trigcond(descr1.lang_code = 'en')"
}
},
{
"table": {
"table_name": "companies",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["company_id"],
"ref": ["tmall.products.company_id"],
"loops": 12.68596624,
"rows": 1,
"cost": 0.022139165,
"filtered": 100,
"attached_condition": "trigcond(companies.`status` = 'A' or products.company_id = 0)"
}
},
{
"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": ["tmall.products_categories.product_id"],
"loops": 12.68596624,
"rows": 2,
"cost": 0.011583932,
"filtered": 93.5160141,
"attached_condition": "prices.lower_limit = 1 and prices.usergroup_id in (0,0,1)",
"using_index": true
}
}
]
}
}
}
}
}
}
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 |
| 12 |
100g Pants |
CS-Cart |
12 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 78 |
adizero Rush Shoes |
CS-Cart |
78 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 79 |
adiZero Tempaia Shoes |
CS-Cart |
79 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 11 |
Collegiate 72 Tee |
CS-Cart |
11 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 41 |
Gift Set (Onesie Plus Socks) |
CS-Cart |
41 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 81 |
Minnetonka Original Cowhide Driving Moc |
CS-Cart |
81 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 107 |
Montblanc Classic Collection Money Clip |
CS-Cart |
107 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 109 |
Montblanc Contemporary Collection Key Ring with Montblanc emblem |
CS-Cart |
109 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 91 |
Montblanc Nicolas Rieussec Chronograph Automatic |
CS-Cart |
91 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 92 |
Montblanc TimeWalker Automatic |
CS-Cart |
92 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 34 |
Nike "Untouchable" Women's Tank Top |
CS-Cart |
34 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 15 |
Nike Chambray Super Runner Men's Jacket |
ACME Corp |
15 |
P |
0 |
P |
0 |
0 |
0 |
2 |
| 31 |
Nike Classic Solid Women's Jersey Shorts |
CS-Cart |
31 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 38 |
Nike Futura Unravel Women's T-Shirt |
CS-Cart |
38 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 80 |
Nike Tenkay Slip TXTL Women's Shoe |
CS-Cart |
80 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 102 |
PR 100 Women's White Quartz Watch |
CS-Cart |
102 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 28 |
Run Perf 7/8 Ti |
CS-Cart |
28 |
P |
0 |
P |
0 |
0 |
0 |
1 |
| 280 |
T-shirt, Color: Black |
CS-Cart |
280,281 |
P,V |
0,280 |
V |
280 |
0 |
0 |
1 |
| 282 |
T-shirt, Color: Blue |
CS-Cart |
282,283,284 |
P,V,V |
0,282,282 |
P |
0 |
0 |
0 |
1 |
| 278 |
T-shirt, Color: White |
CS-Cart |
278,279 |
P,V |
0,278 |
P |
0 |
0 |
0 |
1 |