Query time 0.00082
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "21.81"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 23,
"rows_produced_per_join": 23,
"filtered": "100.00",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (11237,11259,11279,11299,11813,11819,11825,11831,11838,11844,11851,11869))",
"cost_info": {
"read_cost": "11.06",
"eval_cost": "2.30",
"prefix_cost": "13.36",
"data_read_per_join": "368"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"gaseus.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "5.75",
"eval_cost": "0.12",
"prefix_cost": "21.41",
"data_read_per_join": "4K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`gaseus`.`cscart_categories`.`storefront_id` in (0,1)) and ((`gaseus`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`gaseus`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`gaseus`.`cscart_categories`.`usergroup_ids`))) and (`gaseus`.`cscart_categories`.`status` in ('A','H')))"
}
},
{
"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",
"gaseus.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.29",
"eval_cost": "0.12",
"prefix_cost": "21.81",
"data_read_per_join": "18"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 11237 |
306M |
0 |
| 11259 |
306M |
0 |
| 11279 |
306M |
0 |
| 11299 |
306M |
0 |
| 11813 |
306M |
0 |
| 11819 |
306M |
0 |
| 11825 |
306M |
0 |
| 11831 |
306M |
0 |
| 11838 |
306M |
0 |
| 11844 |
306M |
0 |
| 11851 |
306M |
0 |
| 11869 |
306M |
0 |