Query time 0.28196
JSON explain
{
"query_block": {
"select_id": 1,
"filesort": {
"sort_key": "cscart_product_review_start.rating_title desc",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "const",
"possible_keys": ["PRIMARY", "p_category_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"ref": ["const"],
"rows": 1,
"filtered": 100,
"using_index": true
}
},
{
"table": {
"table_name": "cscart_product_review_start",
"access_type": "ALL",
"rows": 10,
"filtered": 100,
"attached_condition": "cscart_product_review_start.lang_code = 'vi'"
}
},
{
"table": {
"table_name": "products_tag_categories",
"access_type": "ref",
"possible_keys": ["PRIMARY", "pt"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"ref": ["const"],
"rows": 1022,
"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_tag_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_product_reviews",
"access_type": "ref",
"possible_keys": ["idx_product_id"],
"key": "idx_product_id",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["dev_db.products_tag_categories.product_id"],
"rows": 5,
"filtered": 100,
"attached_condition": "cscart_product_review_start.rating_value = cscart_product_reviews.rating_value"
}
}
]
}
}
}
}
Result
variant_id |
variant |
5 |
Từ 5 sao |
4 |
Từ 4 sao |
3 |
Từ 3 sao |