Query time 0.09647
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "147.03"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"link_type",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 72,
"rows_produced_per_join": 72,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "8.11",
"eval_cost": "7.20",
"prefix_cost": "15.31",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`maniamall_cscart`.`cscart_products_categories`.`product_id` in (614832,1232975,588096,880671,1088508,697953,796373,591739,612280,1120145,695183,600012,614835,1302601,590335,866417,589124,696523,593274,1232966,1232977,696950,621062,596399,588307,1434961,590366,697334,590358,594343,866380,1233023,562160,694679,595794,589041))"
}
},
{
"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",
"maniamall_cscart.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 72,
"filtered": "100.00",
"cost_info": {
"read_cost": "71.72",
"eval_cost": "7.20",
"prefix_cost": "94.23",
"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": [
"maniamall_cscart.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 3,
"filtered": "5.00",
"cost_info": {
"read_cost": "45.60",
"eval_cost": "0.36",
"prefix_cost": "147.03",
"data_read_per_join": "9K"
},
"used_columns": [
"category_id",
"company_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`maniamall_cscart`.`cscart_categories`.`company_id` = 1) and ((`maniamall_cscart`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`maniamall_cscart`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`maniamall_cscart`.`cscart_categories`.`usergroup_ids`))) and (`maniamall_cscart`.`cscart_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 562160 |
4528,1375M |
|
| 588096 |
8179M |
|
| 588307 |
8243M |
|
| 589041 |
8312M |
|
| 589124 |
8332M |
|
| 590335 |
8392M |
|
| 590358 |
8392M |
|
| 590366 |
8392M |
|
| 591739 |
8371M |
|
| 593274 |
8503M |
|
| 594343 |
43883M |
|
| 595794 |
8198M |
|
| 596399 |
8382M |
|
| 600012 |
42631,8678M |
|
| 612280 |
32420,7891M |
|
| 614832 |
32420,42632,7907M |
|
| 614835 |
32420,42632,3303M |
|
| 621062 |
8771,8772,42631,8776M |
|
| 694679 |
32420,3129M |
|
| 695183 |
32420,42631,8092M |
|
| 696523 |
32420,3207M |
|
| 696950 |
32420,42631,3303M |
|
| 697334 |
32420,3220M |
|
| 697953 |
32420,3339M |
|
| 796373 |
4528,7891,3158M |
|
| 866380 |
4528,8184M |
|
| 866417 |
4528,42630,1325M |
|
| 880671 |
4528,5870M |
|
| 1088508 |
32420,42632,23734M |
|
| 1120145 |
4528,42632,28395M |
|
| 1232966 |
4528,42632,16840M |
|
| 1232975 |
4528,16895M |
|
| 1232977 |
16895M |
|
| 1233023 |
42632,16892M |
|
| 1302601 |
4528,11600,1409M |
|
| 1434961 |
4528,42632,7128M |
|