Query time 0.00305
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "108.06"
},
"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": 87,
"rows_produced_per_join": 87,
"filtered": "100.00",
"index_condition": "(`test_uchur_k`.`cscart_products_categories`.`product_id` in (84,109,118,19,131,146,13,61,95,15,9,85,59,111,144,60,123,145,113,6,14,63,136,50984,127,134,42,50985,50986,50988,50993,50992))",
"cost_info": {
"read_cost": "38.46",
"eval_cost": "8.70",
"prefix_cost": "47.16",
"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": 87,
"filtered": "100.00",
"cost_info": {
"read_cost": "21.75",
"eval_cost": "8.70",
"prefix_cost": "77.61",
"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": 4,
"filtered": "5.00",
"cost_info": {
"read_cost": "21.75",
"eval_cost": "0.44",
"prefix_cost": "108.06",
"data_read_per_join": "23K"
},
"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 |
| 6 |
42,40M,6 |
|
| 9 |
42,6,40M |
|
| 13 |
42,40M,6 |
|
| 14 |
6,42,40M |
|
| 15 |
6,40M,43 |
|
| 19 |
40M,9,44 |
|
| 42 |
391,18M,45 |
|
| 59 |
42,6,40M |
|
| 60 |
40M,42,6 |
|
| 61 |
40M,42,6 |
|
| 63 |
8M,45,394 |
|
| 84 |
28,40M,394,42 |
|
| 85 |
394,28,42,40M |
|
| 95 |
31,43,40M |
|
| 109 |
40M,42,7 |
|
| 111 |
40M,7,42 |
|
| 113 |
6,40M,42 |
|
| 118 |
40M,6,42 |
|
| 123 |
40M,6,42 |
|
| 127 |
34M,45 |
|
| 131 |
42,9,40M |
|
| 134 |
10,45M |
|
| 136 |
45,37M,394 |
|
| 144 |
390,40M,7,42 |
|
| 145 |
42,390,40M,7 |
|
| 146 |
7,390,40M,42 |
|
| 50984 |
45,10M |
|
| 50985 |
10M |
|
| 50986 |
10M |
|
| 50988 |
10M |
|
| 50992 |
25M |
|
| 50993 |
25M |
|