Query time 0.00344
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "189.28"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "51.15"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 383,
"rows_produced_per_join": 15,
"filtered": "4.00",
"cost_info": {
"read_cost": "40.09",
"eval_cost": "1.53",
"prefix_cost": "41.62",
"data_read_per_join": "81K"
},
"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')))"
}
},
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"test_uchur_k.cscart_categories.category_id"
],
"rows_examined_per_scan": 18,
"rows_produced_per_join": 51,
"filtered": "18.55",
"index_condition": "(`test_uchur_k`.`cscart_products_categories`.`product_id` in (82,51076,51073,51072,51074,51075,22711,22710,51077,51080,51078,51079,51132,51131,51134,51133,51130,41,51139,51138,51137,51136,51135,40,51144,51143,51142,51141,51140,39,51146,51145,38,51148,51147,51150,51149,37,51169,51168,51167,51166,90,51171,51170,51205,51204,51203,51202,125,51209,51208,51207,51206,124,51221,137,51224,51223,17,56,126,51295,117,116,115,81,11,106,58,57,5,51349,122,51357,51360,51359,51358,51361,30,51362,51363,51364,51365,31,51366,51367,51368,51369,140,51385,51386,51387,51388,51389,88,51395,51396,51397,51555,51556,80,51398,51399))",
"cost_info": {
"read_cost": "68.94",
"eval_cost": "5.11",
"prefix_cost": "138.14",
"data_read_per_join": "818"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
| 5 |
6,40M,42 |
| 11 |
8,40M,42,394 |
| 17 |
6,40M,44 |
| 30 |
18,40M,44,391 |
| 31 |
18,40M,43,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 |
| 80 |
26,40M |
| 81 |
8,40M,43,394 |
| 82 |
8,40M,44,394 |
| 88 |
40M,42,235 |
| 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 |
| 126 |
8,40M,42,394 |
| 137 |
7,40M,42 |
| 140 |
25,40M,42 |
| 22710 |
18M,40,42,392 |
| 22711 |
18M,40,42,392 |
| 51072 |
18M,40,42,392 |
| 51073 |
18M,40,42,392 |
| 51074 |
18M,40,42,392 |
| 51075 |
18M,40,42,392 |
| 51076 |
18M,40,42,392 |
| 51077 |
18M,40,42,392 |
| 51078 |
18M,40,42,392 |
| 51079 |
18M,40,42,392 |
| 51080 |
18M,40,42,392 |
| 51130 |
10,40M,43 |
| 51131 |
10,40M,43 |
| 51132 |
10,40M,43 |
| 51133 |
10,40M,43 |
| 51134 |
10,40M,43 |
| 51135 |
10,40M,44 |
| 51136 |
10,40M,44 |
| 51137 |
10,40M,44 |
| 51138 |
10,40M,44 |
| 51139 |
10,40M,44 |
| 51140 |
10,40M,42 |
| 51141 |
10,40M,42 |
| 51142 |
10,40M,42 |
| 51143 |
10,40M,42 |
| 51144 |
10,40M,42 |
| 51145 |
10,40M,42 |
| 51146 |
10,40M,42 |
| 51147 |
10,40M,42 |
| 51148 |
10,40M,42 |
| 51149 |
10,40M,42 |
| 51150 |
10,40M,42 |
| 51166 |
9,40M,43 |
| 51167 |
9,40M,43 |
| 51168 |
9,40M,43 |
| 51169 |
9,40M,43 |
| 51170 |
9,40M,43 |
| 51171 |
9,40M,43 |
| 51202 |
7,40M,42 |
| 51203 |
7,40M,42 |
| 51204 |
7,40M,42 |
| 51205 |
7,40M,42 |
| 51206 |
7,40M,42 |
| 51207 |
7,40M,42 |
| 51208 |
7,40M,42 |
| 51209 |
7,40M,42 |
| 51221 |
7,40M,42 |
| 51223 |
7,40M,42 |
| 51224 |
7,40M,42 |
| 51295 |
8,40M,42,394 |
| 51349 |
6,40M,42 |
| 51357 |
18,40M,42,391 |
| 51358 |
18,40M,42,391 |
| 51359 |
18,40M,42,391 |
| 51360 |
18,40M,42,391 |
| 51361 |
18,40M,44,391 |
| 51362 |
18,40M,44,391 |
| 51363 |
18,40M,44,391 |
| 51364 |
18,40M,44,391 |
| 51365 |
18,40M,44,391 |
| 51366 |
18,40M,43,391 |
| 51367 |
18,40M,43,391 |
| 51368 |
18,40M,43,391 |
| 51369 |
18,40M,43,391 |
| 51385 |
25,40M,42 |
| 51386 |
25,40M,42 |
| 51387 |
25,40M,42 |
| 51388 |
25,40M,42 |
| 51389 |
25,40M,42 |
| 51395 |
40M,42,235 |
| 51396 |
40M,42,235 |
| 51397 |
40M,42,235 |
| 51398 |
26,40M |
| 51399 |
26,40M |
| 51555 |
40M,42,235 |
| 51556 |
40M,42,235 |