Query time 0.00112
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "23.41"
},
"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": "(`zdrowy_db`.`cscart_products_categories`.`product_id` in (1446,595,594,2593,876,877,880,881,882,883,949,952,1786,953,1864,1865,1951,1793,1794,1795))",
"cost_info": {
"read_cost": "13.06",
"eval_cost": "2.30",
"prefix_cost": "15.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": [
"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.75",
"eval_cost": "0.12",
"prefix_cost": "23.41",
"data_read_per_join": "7K"
},
"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 |
| 594 |
378M |
| 595 |
378M |
| 876 |
321M |
| 877 |
321M |
| 880 |
321M |
| 881 |
321M |
| 882 |
321M |
| 883 |
321M |
| 949 |
322M |
| 952 |
322M |
| 953 |
322M |
| 1446 |
323M |
| 1786 |
322M |
| 1793 |
325M |
| 1794 |
325M |
| 1795 |
325M |
| 1864 |
325M |
| 1865 |
325M |
| 1951 |
325M |
| 2593 |
378M |