Query time 0.14344
JSON explain
{
"query_block": {
"select_id": 1,
"filesort": {
"sort_key": "cd.category",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "range",
"possible_keys": ["PRIMARY", "p_category_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"rows": 7,
"filtered": 100,
"attached_condition": "cscart_categories.category_id in (96,120,121,122,123,124,126)",
"using_index": true
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "ref",
"possible_keys": ["PRIMARY", "pt"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"ref": ["dev_db.cscart_categories.category_id"],
"rows": 359,
"filtered": 100,
"using_index": true
}
},
{
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "status"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["dev_db.products_categories.product_id"],
"rows": 1,
"filtered": 51.89157104,
"attached_condition": "(products.amount > 0 or products.tracking = 'D') 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": "companies",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["company_id"],
"ref": ["dev_db.products.company_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "companies.`status` = 'A'"
}
},
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "ref",
"possible_keys": ["pt"],
"key": "pt",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["dev_db.products_categories.product_id"],
"rows": 1,
"filtered": 100
}
},
{
"table": {
"table_name": "cd",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "9",
"used_key_parts": ["category_id", "lang_code"],
"ref": ["dev_db.cscart_products_categories.category_id", "const"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(cd.lang_code = 'en')"
}
}
]
}
}
}
}
Result
variant_id |
variant |
96 |
Beverage |
112 |
Cereal, Granola |
123 |
Coffee |
315 |
Corporate Gifts |
120 |
Craft Beer & Wine |
121 |
Fruit Flavored Drinks |
412 |
Gift Box |
119 |
Gift Sets |
110 |
Gifts |
323 |
Gifts For Business Partners |
321 |
Gifts For Colleagues |
210 |
Gifts For Her |
209 |
Gifts For Him |
126 |
Healthy Drinks |
214 |
Healthy Food |
213 |
Holiday Gifts |
166 |
Home Decoration |
117 |
Honey |
340 |
Kitchenware |
124 |
Powder |
169 |
Scented Candles |
212 |
Souvenir |
122 |
Tea and Infusions |