Query time 0.00103
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": 21,
"rows_produced_per_join": 21,
"filtered": "100.00",
"index_condition": "(`zdrowy_db`.`cscart_products_categories`.`product_id` in (540,546,2823,2869,541,547,2700,613,614,1896,615,1897,612,2071,2456,2659,611,916,917,918))",
"cost_info": {
"read_cost": "12.36",
"eval_cost": "2.10",
"prefix_cost": "14.46",
"data_read_per_join": "336"
},
"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": [
"zdrowy_db.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "5.25",
"eval_cost": "0.11",
"prefix_cost": "21.81",
"data_read_per_join": "6K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`zdrowy_db`.`cscart_categories`.`storefront_id` in (0,1)) and ((`zdrowy_db`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`zdrowy_db`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`zdrowy_db`.`cscart_categories`.`usergroup_ids`))) and (`zdrowy_db`.`cscart_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
| 540 |
298M |
| 541 |
298M |
| 546 |
298M |
| 547 |
298M |
| 611 |
285M |
| 612 |
285M |
| 613 |
285M |
| 614 |
285M |
| 615 |
285M |
| 916 |
287M |
| 917 |
289M |
| 918 |
287M |
| 1896 |
285M |
| 1897 |
285M |
| 2071 |
285M |
| 2456 |
285M |
| 2659 |
285M |
| 2700 |
285M |
| 2823 |
298M |
| 2869 |
298M |