Query time 0.00113
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "32.59"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "0.93"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 84,
"rows_produced_per_join": 3,
"filtered": "4.00",
"cost_info": {
"read_cost": "19.53",
"eval_cost": "0.67",
"prefix_cost": "20.20",
"data_read_per_join": "8K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`satishecarter_march_003`.`cscart_categories`.`storefront_id` in (0,1)) and ((`satishecarter_march_003`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`satishecarter_march_003`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`satishecarter_march_003`.`cscart_categories`.`usergroup_ids`)) and (`satishecarter_march_003`.`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": [
"satishecarter_march_003.cscart_categories.category_id"
],
"rows_examined_per_scan": 2,
"rows_produced_per_join": 0,
"filtered": "13.81",
"index_condition": "(`satishecarter_march_003`.`cscart_products_categories`.`product_id` in (73,71,75,72,70,156,175,43,76,56,57,30,246,173,67,25,154,53,52,161,165,166,86,106,105,101,33,32,163,155,55,69))",
"cost_info": {
"read_cost": "9.00",
"eval_cost": "0.19",
"prefix_cost": "30.55",
"data_read_per_join": "14"
},
"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",
"satishecarter_march_003.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.93",
"eval_cost": "0.19",
"prefix_cost": "31.66",
"data_read_per_join": "14"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 25 |
195M |
|
| 30 |
176M |
|
| 32 |
176M |
|
| 33 |
176M |
|
| 43 |
185M |
|
| 52 |
202M |
|
| 53 |
202M |
|
| 55 |
187M |
|
| 56 |
187M |
|
| 57 |
187M |
|
| 67 |
236M |
|
| 69 |
236M |
|
| 70 |
236M |
|
| 71 |
236M |
|
| 72 |
240M |
|
| 73 |
240M |
|
| 75 |
240M |
|
| 76 |
240M |
|
| 86 |
238M |
|
| 101 |
238M |
|
| 105 |
238M |
|
| 106 |
238M |
|
| 154 |
181M |
|
| 155 |
181M |
|
| 156 |
181M |
|
| 161 |
198M,199 |
|
| 163 |
198M,199 |
|
| 165 |
198M,199 |
|
| 166 |
198M,199 |
|
| 173 |
199M |
|
| 175 |
199M |
|
| 246 |
199M |
|