Query time 0.00277
JSON explain
{
"query_block": {
"select_id": 1,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": ["PRIMARY", "pt"],
"key": "pt",
"key_length": "3",
"used_key_parts": ["product_id"],
"rows": 48,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (4468,28168,3847,2455,4358,2296,6460,2781,5474,36500,3661,37825,41944,47172,4293,2445,1811,33362,31962,5464,2453,27367,35480,47225,4291,48683,41416,36277,6445,48677,4464,31961)"
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "c_status", "p_category_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"ref": ["dev_db.cscart_products_categories.category_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "cscart_categories.storefront_id in (0,1) 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')"
}
},
{
"table": {
"table_name": "product_position_source",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "pt"],
"key": "PRIMARY",
"key_length": "6",
"used_key_parts": ["category_id", "product_id"],
"ref": ["const", "dev_db.cscart_products_categories.product_id"],
"rows": 1,
"filtered": 100
}
}
]
}
}
Result
product_id |
category_ids |
position |
1811 |
181M |
|
2296 |
169M |
|
2445 |
176M |
|
2453 |
169M |
|
2455 |
169M |
|
2781 |
181M |
|
3661 |
169M |
|
3847 |
181M |
|
4291 |
143M |
|
4293 |
143M |
|
4358 |
191M |
|
4464 |
191M |
|
4468 |
191M |
|
5464 |
191M |
|
5474 |
191M |
|
6445 |
313,210,144M |
|
6460 |
144M |
|
27367 |
169M |
|
28168 |
212M |
|
31961 |
213,169M |
|
31962 |
213,169M |
|
33362 |
169M |
|
35480 |
169M |
|
36277 |
181M |
|
36500 |
212,213,199M |
|
37825 |
166M |
|
41416 |
144M |
|
41944 |
112M |
|
47172 |
210,169M |
|
47225 |
181M |
|
48677 |
409,315,213,210,169M |
|
48683 |
210,213,409,315,169M |
|