Query time 0.00111
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": 36,
"filtered": 100,
"index_condition": "cscart_products_categories.product_id in (180,18,16,9,10,24,189,190,245,239,238,23,22,25,19,65,64,62,134,135,74,73,71,75,72,255,21,70,76,30,246,29)"
}
},
{
"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": ["cscart.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", "cscart.cscart_products_categories.product_id"],
"rows": 1,
"filtered": 100
}
}
]
}
}
Result
| product_id |
category_ids |
position |
| 9 |
190,193M |
|
| 10 |
190,193M |
|
| 16 |
194M |
|
| 18 |
194M |
|
| 19 |
194M |
|
| 21 |
194M |
|
| 22 |
195M |
|
| 23 |
195M |
|
| 24 |
195M |
|
| 25 |
195M |
|
| 29 |
176M |
|
| 30 |
176M |
|
| 62 |
189M |
|
| 64 |
189M |
|
| 65 |
189M |
|
| 70 |
236M |
|
| 71 |
236M |
|
| 72 |
240M |
|
| 73 |
240M |
|
| 74 |
240M |
|
| 75 |
240M |
|
| 76 |
240M |
|
| 134 |
179,182M |
|
| 135 |
179,182M |
|
| 180 |
200M |
|
| 189 |
200M |
|
| 190 |
200M |
|
| 238 |
235M |
|
| 239 |
235M |
|
| 245 |
235M |
|
| 246 |
199M |
|
| 255 |
260M |
|