Query time 0.02286
JSON explain
{
"query_block": {
"select_id": 1,
"filesort": {
"sort_key": "cd.category",
"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": "products_tag_categories",
"access_type": "ref",
"possible_keys": ["PRIMARY", "pt"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"ref": ["const"],
"rows": 113,
"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_products_categories",
"access_type": "ref",
"possible_keys": ["pt"],
"key": "pt",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["dev_db.products_tag_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 = 'vi')"
}
}
]
}
}
}
}
Result
variant_id |
variant |
194 |
Ảnh Nghệ Thuật |
119 |
Bộ Quà Tặng Thực Phẩm |
160 |
Bóp, Ví |
124 |
Bột Pha |
191 |
Búp Bê và Mô Hình |
123 |
Cà Phê |
550 |
Chus Exclusive |
153 |
Diêm và Bật Lửa |
111 |
Hạt, Mứt |
412 |
Hộp Quà Tặng |
149 |
Móc Khoá |
169 |
Nến Thơm |
105 |
Nghệ Thuật và Thủ Công |
141 |
Nhẫn |
99 |
Phụ kiện |
212 |
Quà Lưu Niệm |
110 |
Quà Tặng |
409 |
Quà Tặng Cá Nhân Hóa |
209 |
Quà Tặng Cho Nam |
210 |
Quà Tặng Cho Nữ |
315 |
Quà Tặng Doanh Nghiệp |
213 |
Quà Tặng Ngày Lễ |
211 |
Quà Tặng Thiếu Nhi |
323 |
Quà Tặng Đối Tác - Khách Hàng |
321 |
Quà Tặng Đồng Nghiệp |
114 |
Socola |
184 |
Thiền Tịnh |
199 |
Thiệp, Bưu Thiếp |
316 |
Thời Trang Nam |
317 |
Thời Trang Nữ |
215 |
Thú Nhồi Bông |
122 |
Trà và Trà Thảo Mộc |
166 |
Trang Trí Nhà Cửa |
195 |
Tranh Vẽ và Minh Hoạ |
157 |
Túi Tái Chế |
142 |
Vòng Tay |
116 |
Đồ Ăn Vặt |
107 |
Đồ chơi |
340 |
Đồ Dùng Nhà Bếp |
165 |
Đồ Nội Thất |