Query time 0.00246
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "59.99"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "0.90"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 46,
"rows_produced_per_join": 1,
"filtered": "4.00",
"cost_info": {
"read_cost": "5.15",
"eval_cost": "0.18",
"prefix_cost": "5.33",
"data_read_per_join": "7K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`test2_gaseus`.`cscart_categories`.`storefront_id` in (0,1)) and ((`test2_gaseus`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`test2_gaseus`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`test2_gaseus`.`cscart_categories`.`usergroup_ids`))) and (`test2_gaseus`.`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": [
"test2_gaseus.cscart_categories.category_id"
],
"rows_examined_per_scan": 83,
"rows_produced_per_join": 0,
"filtered": "0.59",
"index_condition": "(`test2_gaseus`.`cscart_products_categories`.`product_id` in (1516,6623,1504,1494,6209,1499,1489,1433,6614,2268,2269,2270,2271,2336,2337,2338,2339,2412,2413,2414,2415,2416,2417,2418,2419,2420,2514,2515,2516,2517,2518,2604,2605,2606,2607,3840,3841,3842,3843,5867,5868,5869,5870,5871,5935,5936,5937,5938))",
"cost_info": {
"read_cost": "38.18",
"eval_cost": "0.09",
"prefix_cost": "58.78",
"data_read_per_join": "14"
},
"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",
"test2_gaseus.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.22",
"eval_cost": "0.09",
"prefix_cost": "59.10",
"data_read_per_join": "14"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1433 |
308M |
|
| 1489 |
308M |
|
| 1494 |
308M |
|
| 1499 |
308M |
|
| 1504 |
308M |
|
| 1516 |
308M |
|
| 2268 |
308M |
|
| 2269 |
308M |
|
| 2270 |
308M |
|
| 2271 |
308M |
|
| 2336 |
308M |
|
| 2337 |
308M |
|
| 2338 |
308M |
|
| 2339 |
308M |
|
| 2412 |
308M |
|
| 2413 |
308M |
|
| 2414 |
308M |
|
| 2415 |
308M |
|
| 2416 |
308M |
|
| 2417 |
308M |
|
| 2418 |
308M |
|
| 2419 |
308M |
|
| 2420 |
308M |
|
| 2514 |
308M |
|
| 2515 |
308M |
|
| 2516 |
308M |
|
| 2517 |
308M |
|
| 2518 |
308M |
|
| 2604 |
308M |
|
| 2605 |
308M |
|
| 2606 |
308M |
|
| 2607 |
308M |
|
| 3840 |
308M |
|
| 3841 |
308M |
|
| 3842 |
308M |
|
| 3843 |
308M |
|
| 5867 |
308M |
|
| 5868 |
308M |
|
| 5869 |
308M |
|
| 5870 |
308M |
|
| 5871 |
308M |
|
| 5935 |
308M |
|
| 5936 |
308M |
|
| 5937 |
308M |
|
| 5938 |
308M |
|
| 6209 |
308M |
|
| 6614 |
308M |
|
| 6623 |
308M |
|