Query time 0.00079
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "19.98"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "6.00"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 7,
"rows_produced_per_join": 0,
"filtered": "14.29",
"cost_info": {
"read_cost": "3.38",
"eval_cost": "0.20",
"prefix_cost": "3.58",
"data_read_per_join": "4K"
},
"used_columns": [
"category_id",
"company_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`db_emaika1`.`cscart_categories`.`company_id` = 1) and ((`db_emaika1`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`db_emaika1`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`db_emaika1`.`cscart_categories`.`usergroup_ids`)) and (`db_emaika1`.`cscart_categories`.`status` in ('A','H')))"
}
},
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"db_emaika1.cscart_categories.category_id"
],
"rows_examined_per_scan": 6,
"rows_produced_per_join": 5,
"filtered": "100.00",
"index_condition": "(`db_emaika1`.`cscart_products_categories`.`product_id` in (6,4,5,3,1,2))",
"cost_info": {
"read_cost": "2.00",
"eval_cost": "1.20",
"prefix_cost": "6.78",
"data_read_per_join": "95"
},
"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",
"db_emaika1.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 5,
"filtered": "100.00",
"cost_info": {
"read_cost": "6.00",
"eval_cost": "1.20",
"prefix_cost": "13.98",
"data_read_per_join": "95"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
product_id |
category_ids |
position |
1 |
1M |
0 |
2 |
1M |
0 |
3 |
1M |
0 |
4 |
1M |
0 |
5 |
1M |
0 |
6 |
1M |
0 |