Query time 0.00295
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "129.91"
},
"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": 106,
"rows_produced_per_join": 106,
"filtered": "100.00",
"index_condition": "(`test_uchur_k`.`cscart_products_categories`.`product_id` in (51358,115,37,11,140,41,30,90,38,124,81,56,135,82,116,117,125,106,39,193,65,40,22710,22711,17,57,122,58,5,22,18,27))",
"cost_info": {
"read_cost": "45.11",
"eval_cost": "10.60",
"prefix_cost": "55.71",
"data_read_per_join": "1K"
},
"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",
"test_uchur_k.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 106,
"filtered": "100.00",
"cost_info": {
"read_cost": "26.50",
"eval_cost": "10.60",
"prefix_cost": "92.81",
"data_read_per_join": "1K"
},
"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": [
"test_uchur_k.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 5,
"filtered": "5.00",
"cost_info": {
"read_cost": "26.50",
"eval_cost": "0.53",
"prefix_cost": "129.91",
"data_read_per_join": "28K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`test_uchur_k`.`cscart_categories`.`storefront_id` in (0,1)) and ((`test_uchur_k`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`test_uchur_k`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`test_uchur_k`.`cscart_categories`.`usergroup_ids`))) and (`test_uchur_k`.`cscart_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 5 |
6,40M,42 |
|
| 11 |
8,40M,42,394 |
|
| 17 |
6,40M,44 |
|
| 18 |
6,40M,43 |
|
| 22 |
6,40M,42 |
|
| 27 |
6,40M,42 |
|
| 30 |
18,40M,44,391 |
|
| 37 |
10,40M,42 |
|
| 38 |
10,40M,42 |
|
| 39 |
10,40M,42 |
|
| 40 |
10,40M,44 |
|
| 41 |
10,40M,43 |
|
| 56 |
8,40M,42,394 |
|
| 57 |
6,40M,44 |
|
| 58 |
6,40M,43 |
|
| 65 |
25M,45 |
|
| 81 |
8,40M,43,394 |
|
| 82 |
8,40M,44,394 |
|
| 90 |
9,40M,43 |
|
| 106 |
6,40M,43,394 |
|
| 115 |
8,40M,42,394 |
|
| 116 |
8,40M,42,394 |
|
| 117 |
8,40M,42,394 |
|
| 122 |
6,40M,42 |
|
| 124 |
7,40M,42 |
|
| 125 |
7,40M,42 |
|
| 135 |
36M,45,394 |
|
| 140 |
25,40M,42 |
|
| 193 |
9,40M,43 |
|
| 22710 |
18M,40,42,392 |
|
| 22711 |
18M,40,42,392 |
|
| 51358 |
18,40M,42,391 |
|