Query time 0.12591
JSON explain
{
"query_block": {
"select_id": 1,
"filesort": {
"sort_key": "if(products.product_type = 'C',(subquery#2) > 0,if(products.amount > 0,1,if(products.tracking = 'O',1,0))) desc, if(shared_descr.product_id is not null,shared_descr.product,descr1.product), products.product_id",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "companies",
"access_type": "system",
"possible_keys": ["PRIMARY"],
"rows": 1,
"filtered": 100
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": ["PRIMARY", "c_status", "p_category_id"],
"rows": 525,
"filtered": 20.5714283,
"attached_condition": "cscart_categories.category_id in (387,745,741,1112,693,679,681,659,657,1022,1108,582,1073,713,574,522,470,479,481,651,515,754,760,1097,744,1105,1106,726,1110,755,743,450,1104,429,430,434,435,448,415,1098,594,1066,1107,468,489,493,497,498,499,500,758,414,388,765,768,774,777,782,784,786,1087,792,794,1131,819,828,1094,833,837,844,1134,1109,1099,1100,1101,1102,1103,884,885,1088,939,941,942,950,952,961,1186,1021,1016,1017,1028,1032,1135,1188,1168,1185,1156,1157,1162,1166,1169,1171,1179,1181,1182,1183,1184,1192) and (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": ["lillyshop_lillyshop.cscart_categories.category_id"],
"rows": 26,
"filtered": 100,
"using_index": true
}
},
{
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "status", "idx_parent_product_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["lillyshop_lillyshop.products_categories.product_id"],
"rows": 1,
"filtered": 90.49367523,
"attached_condition": "products.parent_product_id = 0 and products.company_id = 1 and (products.usergroup_ids = '' or find_in_set(0,products.usergroup_ids) or find_in_set(1,products.usergroup_ids)) and products.`status` = 'A'"
}
},
{
"table": {
"table_name": "shared_descr",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "product_id", "company_id"],
"key": "PRIMARY",
"key_length": "13",
"used_key_parts": ["product_id", "lang_code", "company_id"],
"ref": [
"lillyshop_lillyshop.products_categories.product_id",
"const",
"const"
],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(shared_descr.lang_code = 'en')"
}
},
{
"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": [
"lillyshop_lillyshop.products_categories.product_id",
"const"
],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(descr1.lang_code = 'en')"
}
},
{
"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": ["lillyshop_lillyshop.products_categories.product_id"],
"rows": 1,
"filtered": 99.99145508,
"attached_condition": "prices.lower_limit = 1 and prices.usergroup_id in (0,0,1)",
"using_index": true
}
},
{
"table": {
"table_name": "img_links",
"access_type": "ref",
"possible_keys": ["PRIMARY", "object_id"],
"key": "object_id",
"key_length": "81",
"used_key_parts": ["object_id", "object_type", "type"],
"ref": [
"lillyshop_lillyshop.products_categories.product_id",
"const",
"const"
],
"rows": 1,
"filtered": 100,
"index_condition": "img_links.object_id = products_categories.product_id and img_links.object_type = 'product' and img_links.`type` = 'M'",
"attached_condition": "img_links.pair_id > 0"
}
}
],
"subqueries": [
{
"expression_cache": {
"state": "uninitialized",
"query_block": {
"select_id": 2,
"nested_loop": [
{
"table": {
"table_name": "cscart_products",
"access_type": "ALL",
"possible_keys": ["idx_parent_product_id"],
"rows": 11707,
"filtered": 100,
"attached_condition": "cscart_products.parent_product_id = products.product_id"
}
}
]
}
}
}
]
}
}
}
}
Result
| product_id |
product |
company_name |
product_type |
parent_product_id |
instock_marker |
instock_sorting |
| 18727 |
Reflective gel polish DIS Flash #02 beige, 7.5 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 18750 |
Reflective gel polish DIS Flash #03 pink, 7.5 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 18728 |
Reflective gel polish DIS Flash #04 cocoa, 7.5 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 18729 |
Reflective gel polish DIS Flash #05 gray, 7.5 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 18731 |
Reflective gel polish DIS Flash #07 pink cocoa, 7.5 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 18733 |
Reflective gel polish DIS Flash #09 blue, 7.5 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 18734 |
Reflective gel polish DIS Flash #10 fuchsia, 7.5 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 18735 |
Reflective gel polish DIS Flash #11 red, 7.5 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 18737 |
Reflective gel polish DIS Flash #13 green, 7.5 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 18736 |
Reflective gel polish DIS Flash No. 12 black, 7.5 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 18738 |
Reflective gel polish DIS Flash No. 14 burgundy, 7.5 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 18739 |
Reflective gel polish DIS Flash No. 15 lavender, 7.5 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 20047 |
Reflective gel polish DIS Flash No. 16 brown, 7.5 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 17986 |
Reflective top for FOX Flash gel polish with silver glitter, 7 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 17976 |
Reflective top for FOX Flash Opal gel polish with opal sparkles, 6 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 19106 |
Reform Turmeric acid orange gel polish, 10 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 19107 |
Reforma Baby doll coral gel polish, 10 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 11456 |
Reforma Fringe gel polish (grey-blue enamel) 10 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 11172 |
Reforma Giselle gel polish (gentle cream enamel) 10 ml removed |
LILLYSHOP |
P |
0 |
1 |
0 |
| 7613 |
ReformA Louise gel polish (cream enamel) 10 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 7522 |
ReformA Minnie gel polish (neon red-pink enamel) 10 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 11230 |
Reforma Montreal gel polish (red enamel) 10 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 10378 |
Reforma Moulin Rouge gel polish (neon red enamel) 10 ml |
LILLYSHOP |
P |
0 |
1 |
0 |
| 13102 |
Reforma Orgasm burgundy gel polish 10 ml |
LILLYSHOP |
P |
0 |
1 |
0 |