Query time 0.00330
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "167.76"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "21.94"
},
"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": 21,
"filtered": "7.96",
"index_condition": "(`test_uchur_k`.`cscart_products_categories`.`product_id` in (51497,51498,51496,105,126,115,11,81,56,135,82,116,117,106,17,57,122,58,5,22,18,27,121,119,141,23,4,142,120,62,108,107,10,16,114,118,13,61,15,9,59,123,60,113,6,14,63))",
"cost_info": {
"read_cost": "68.94",
"eval_cost": "2.19",
"prefix_cost": "138.14",
"data_read_per_join": "351"
},
"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": 21,
"filtered": "100.00",
"cost_info": {
"read_cost": "5.49",
"eval_cost": "2.19",
"prefix_cost": "145.82",
"data_read_per_join": "351"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 4 |
6,40M,42 |
|
| 5 |
6,40M,42 |
|
| 6 |
6,40M,42 |
|
| 9 |
6,40M,42 |
|
| 10 |
6,40M,42 |
|
| 11 |
8,40M,42,394 |
|
| 13 |
6,40M,42 |
|
| 14 |
6,40M,42 |
|
| 15 |
6,40M,43 |
|
| 16 |
6,40M,44 |
|
| 17 |
6,40M,44 |
|
| 18 |
6,40M,43 |
|
| 22 |
6,40M,42 |
|
| 23 |
6,40M,42 |
|
| 27 |
6,40M,42 |
|
| 56 |
8,40M,42,394 |
|
| 57 |
6,40M,44 |
|
| 58 |
6,40M,43 |
|
| 59 |
6,40M,42 |
|
| 60 |
6,40M,42 |
|
| 61 |
6,40M,42 |
|
| 62 |
6,40M,42 |
|
| 63 |
8M,45,394 |
|
| 81 |
8,40M,43,394 |
|
| 82 |
8,40M,44,394 |
|
| 105 |
6,40M,44,394 |
|
| 106 |
6,40M,43,394 |
|
| 107 |
33,40M,42 |
|
| 108 |
33,40M,42 |
|
| 113 |
6,40M,42 |
|
| 114 |
6,40M,42 |
|
| 115 |
8,40M,42,394 |
|
| 116 |
8,40M,42,394 |
|
| 117 |
8,40M,42,394 |
|
| 118 |
6,40M,42 |
|
| 119 |
6,40M,42 |
|
| 120 |
6,40M,42 |
|
| 121 |
6,40M,42 |
|
| 122 |
6,40M,42 |
|
| 123 |
6,40M,42 |
|
| 126 |
8,40M,42,394 |
|
| 135 |
36M,45,394 |
|
| 141 |
6,40M,42 |
|
| 142 |
6,40M,42 |
|
| 51496 |
33M,40 |
|
| 51497 |
33M,40 |
|
| 51498 |
33M,40 |
|