Query time 0.00335
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "39.26"
},
"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": 30,
"rows_produced_per_join": 30,
"filtered": "100.00",
"index_condition": "(`zdrowy_db`.`cscart_products_categories`.`product_id` in (2851,2548,466,2522,2153,621,2852,619,620,680,679,681,976,975,977,289,2670,335,332))",
"cost_info": {
"read_cost": "15.26",
"eval_cost": "3.00",
"prefix_cost": "18.26",
"data_read_per_join": "480"
},
"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",
"zdrowy_db.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 30,
"filtered": "100.00",
"cost_info": {
"read_cost": "7.50",
"eval_cost": "3.00",
"prefix_cost": "28.76",
"data_read_per_join": "480"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
},
{
"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": "7.50",
"eval_cost": "0.15",
"prefix_cost": "39.26",
"data_read_per_join": "9K"
},
"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 |
position |
| 289 |
293,584M |
0 |
| 332 |
293,584M |
0 |
| 335 |
584M,293 |
0 |
| 466 |
580M,293 |
0 |
| 619 |
581M,293 |
0 |
| 620 |
581M,293 |
0 |
| 621 |
293,581M |
0 |
| 679 |
582M,293 |
0 |
| 680 |
582M,293 |
0 |
| 681 |
582M,293 |
0 |
| 975 |
583M,293 |
0 |
| 976 |
575M,293 |
0 |
| 977 |
575M,293 |
0 |
| 2153 |
581M,293 |
0 |
| 2522 |
580M |
|
| 2548 |
580M |
|
| 2670 |
584M |
|
| 2851 |
580M |
|
| 2852 |
581M |
|