Query time 0.00102
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "40.36"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "ushop_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 29,
"rows_produced_per_join": 29,
"filtered": "100.00",
"index_condition": "(`marketplace`.`ushop_products_categories`.`product_id` in (346,345,337,321,347,323,317,326,314,327,313,324,332,316,341,333,335,339,334,336,340,343,338,342,348,344,349,536))",
"cost_info": {
"read_cost": "17.16",
"eval_cost": "2.90",
"prefix_cost": "20.06",
"data_read_per_join": "464"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"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",
"marketplace.ushop_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 29,
"filtered": "100.00",
"cost_info": {
"read_cost": "7.25",
"eval_cost": "2.90",
"prefix_cost": "30.21",
"data_read_per_join": "464"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
},
{
"table": {
"table_name": "ushop_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"marketplace.ushop_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "7.25",
"eval_cost": "0.15",
"prefix_cost": "40.36",
"data_read_per_join": "4K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`marketplace`.`ushop_categories`.`storefront_id` in (0,1)) and ((`marketplace`.`ushop_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`marketplace`.`ushop_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`marketplace`.`ushop_categories`.`usergroup_ids`))) and (`marketplace`.`ushop_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 313 |
354M |
|
| 314 |
354M |
|
| 316 |
354M |
|
| 317 |
354M |
|
| 321 |
355M |
|
| 323 |
355M |
|
| 324 |
355M |
|
| 326 |
355M |
|
| 327 |
355M |
|
| 332 |
355M |
|
| 333 |
355M |
|
| 334 |
355M |
|
| 335 |
355M |
|
| 336 |
355M |
|
| 337 |
355M |
|
| 338 |
355M |
|
| 339 |
355M |
|
| 340 |
355M |
|
| 341 |
355M |
|
| 342 |
355M |
|
| 343 |
355M |
|
| 344 |
354M |
|
| 345 |
357M |
|
| 346 |
357M |
|
| 347 |
357M |
|
| 348 |
357M |
|
| 349 |
357M |
|
| 536 |
318M |
0 |