Query time 0.01345
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": 51,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (5589,5447,4365,31886,5469,4468,4358,5464,5474,5962,4464,4364,4466,31897,47280,4359,5481,5459,31896,48032,4357,48322,31892,31890,4467,47088,31898,5483,47090,48033,48030,48037)"
}
},
{
"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 |
4357 |
191M |
0 |
4358 |
191M |
0 |
4359 |
191M |
0 |
4364 |
191M |
0 |
4365 |
191M |
0 |
4464 |
191M |
0 |
4466 |
191M |
0 |
4467 |
191M |
0 |
4468 |
191M |
0 |
5447 |
191M |
0 |
5459 |
191M |
0 |
5464 |
191M |
0 |
5469 |
191M |
0 |
5474 |
191M |
0 |
5481 |
191M |
0 |
5483 |
191M |
0 |
5589 |
191M |
0 |
5962 |
191M |
0 |
31886 |
191M |
0 |
31890 |
191M |
0 |
31892 |
191M |
0 |
31896 |
191M |
0 |
31897 |
191M |
0 |
31898 |
191M |
0 |
47088 |
166,191M |
0 |
47090 |
166,191M |
0 |
47280 |
191,215,166M |
0 |
48030 |
191,211,110,213M |
0 |
48032 |
191,213,110,211M |
0 |
48033 |
191,213,110,211M |
0 |
48037 |
211,191,213M |
0 |
48322 |
212,315,191M |
0 |