Query time 0.00375
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "14.77"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "4.80"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 60,
"rows_produced_per_join": 2,
"filtered": "4.00",
"cost_info": {
"read_cost": "6.01",
"eval_cost": "0.24",
"prefix_cost": "6.25",
"data_read_per_join": "6K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`aerokidsshop`.`cscart_categories`.`storefront_id` in (0,1)) and ((`aerokidsshop`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`aerokidsshop`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`aerokidsshop`.`cscart_categories`.`usergroup_ids`))) and (`aerokidsshop`.`cscart_categories`.`status` in ('A','H')))"
}
},
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"link_type",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"aerokidsshop.cscart_categories.category_id"
],
"rows_examined_per_scan": 6,
"rows_produced_per_join": 4,
"filtered": "33.33",
"cost_info": {
"read_cost": "0.60",
"eval_cost": "0.48",
"prefix_cost": "8.29",
"data_read_per_join": "76"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`aerokidsshop`.`cscart_products_categories`.`product_id` in (328,325,326,320,318,316,314,319,322,321,315,323,317,324,329,313,312,311))"
}
},
{
"table": {
"table_name": "product_position_source",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"product_id"
],
"key_length": "6",
"ref": [
"const",
"aerokidsshop.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 4,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.20",
"eval_cost": "0.48",
"prefix_cost": "9.97",
"data_read_per_join": "76"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 311 |
315M |
|
| 312 |
315M |
|
| 313 |
315M |
|
| 314 |
315M |
|
| 315 |
315M |
|
| 316 |
315M |
|
| 317 |
315M |
|
| 318 |
315M |
|
| 319 |
315M |
|
| 320 |
315M |
|
| 321 |
315M |
|
| 322 |
315M |
|
| 323 |
315M |
|
| 324 |
315M |
|
| 325 |
315M |
|
| 326 |
315M |
|
| 328 |
315M |
|
| 329 |
315M |
|