Query time 0.00036
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "5.42"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "1.50"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 15,
"rows_produced_per_join": 0,
"filtered": "6.67",
"cost_info": {
"read_cost": "1.65",
"eval_cost": "0.10",
"prefix_cost": "1.75",
"data_read_per_join": "2K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`shoptheindependents_com`.`cscart_categories`.`storefront_id` in (0,1)) and ((`shoptheindependents_com`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`shoptheindependents_com`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`shoptheindependents_com`.`cscart_categories`.`usergroup_ids`))) and (`shoptheindependents_com`.`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": [
"shoptheindependents_com.cscart_categories.category_id"
],
"rows_examined_per_scan": 13,
"rows_produced_per_join": 1,
"filtered": "10.79",
"cost_info": {
"read_cost": "0.25",
"eval_cost": "0.15",
"prefix_cost": "3.39",
"data_read_per_join": "23"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`shoptheindependents_com`.`cscart_products_categories`.`product_id` in (2807,2806,2802,2801,2799))"
}
},
{
"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",
"shoptheindependents_com.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.37",
"eval_cost": "0.15",
"prefix_cost": "3.92",
"data_read_per_join": "23"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 2799 |
2M,187,211 |
0 |
| 2801 |
2M,187,211 |
0 |
| 2802 |
2M,187,211 |
0 |
| 2806 |
2M,187,211 |
0 |
| 2807 |
2,187M,211 |
0 |