Query time 0.00309
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "108.11"
},
"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": 120,
"rows_produced_per_join": 120,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (3112,3944,3664,3126,2230,2655,3741,5683,3440,5890,2226,5859,3843,3840,3130,3441,3811,6054,2221,5891,3153,3924,3377,2522,2719,6041,5111,3385,5948,8240,3551,3831,5927,3289,10078,3382,3519,3356,6093,6194))",
"cost_info": {
"read_cost": "52.01",
"eval_cost": "12.00",
"prefix_cost": "64.01",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"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": [
"softwarepirmam_hewadelivard_cscart_4.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 6,
"filtered": "5.00",
"cost_info": {
"read_cost": "30.00",
"eval_cost": "0.60",
"prefix_cost": "106.01",
"data_read_per_join": "18K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`storefront_id` in (0,1)) and ((`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids`))) and (`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`status` in ('A','H')))"
}
},
{
"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",
"softwarepirmam_hewadelivard_cscart_4.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 6,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.50",
"eval_cost": "0.60",
"prefix_cost": "108.11",
"data_read_per_join": "96"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 2221 |
424,423,451,166M |
0 |
| 2226 |
424,423,450,166M |
0 |
| 2230 |
424,423,450,166M |
0 |
| 2522 |
423,424,452,166M |
0 |
| 2655 |
423,424,450,166M |
0 |
| 2719 |
423,424,450,166M |
0 |
| 3112 |
423,424,452,166M |
0 |
| 3126 |
423,424,451,166M |
0 |
| 3130 |
477,423,166M |
0 |
| 3153 |
423,451,424,166M |
0 |
| 3289 |
450,424,423,166M |
0 |
| 3356 |
424,423,166M |
0 |
| 3377 |
492,424,423,166M |
0 |
| 3382 |
423,424,450,166M |
0 |
| 3385 |
423,424,450,166M |
0 |
| 3440 |
166,423,448M |
0 |
| 3441 |
166,423,448M |
0 |
| 3519 |
423,424,166M |
0 |
| 3551 |
424,423,166M |
0 |
| 3664 |
423,424,450,166M |
0 |
| 3741 |
423,166,448M |
0 |
| 3811 |
423,449,166M |
0 |
| 3831 |
423,424,450,166M |
0 |
| 3840 |
423,424,450,166M |
0 |
| 3843 |
423,424,450,166M |
0 |
| 3924 |
423,426,166M |
0 |
| 3944 |
425,423,166M |
0 |
| 5111 |
450,423,424,166M |
0 |
| 5683 |
423,585,166M |
0 |
| 5859 |
423,424,426,166M |
0 |
| 5890 |
423,424,450,166M |
0 |
| 5891 |
423,424,450,166M |
0 |
| 5927 |
308,250,350,423,166,387,383M |
0 |
| 5948 |
423,166,585M |
0 |
| 6041 |
423,166,585M |
0 |
| 6054 |
423,166,585M |
0 |
| 6093 |
423,166,449M |
0 |
| 6194 |
423,166,449M |
0 |
| 8240 |
492,657M |
|
| 10078 |
448M |
|