Query time 0.00135
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "140.08"
},
"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": 164,
"rows_produced_per_join": 164,
"filtered": "100.00",
"index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_products_categories`.`product_id` in (11309,11430,11479,11362,11520,11600,11128,11414,11535,11633,11199,11390,11399,11530,11236,11289,11462,11136,11193,11352,11458,11267,11293,11308))",
"cost_info": {
"read_cost": "63.41",
"eval_cost": "16.40",
"prefix_cost": "79.81",
"data_read_per_join": "2K"
},
"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": 8,
"filtered": "5.00",
"cost_info": {
"read_cost": "41.00",
"eval_cost": "0.82",
"prefix_cost": "137.21",
"data_read_per_join": "25K"
},
"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": 8,
"filtered": "100.00",
"cost_info": {
"read_cost": "2.05",
"eval_cost": "0.82",
"prefix_cost": "140.08",
"data_read_per_join": "131"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 11128 |
664M |
0 |
| 11136 |
664M |
0 |
| 11193 |
664M |
0 |
| 11199 |
664M |
0 |
| 11236 |
664M |
0 |
| 11267 |
664M |
0 |
| 11289 |
664M |
0 |
| 11293 |
664M |
0 |
| 11308 |
664M |
0 |
| 11309 |
664M |
0 |
| 11352 |
664M |
0 |
| 11362 |
664M |
0 |
| 11390 |
664M |
0 |
| 11399 |
664M |
0 |
| 11414 |
664M |
0 |
| 11430 |
664M |
0 |
| 11458 |
664M |
0 |
| 11462 |
664M |
0 |
| 11479 |
664M |
0 |
| 11520 |
664M |
0 |
| 11530 |
664M |
0 |
| 11535 |
664M |
0 |
| 11600 |
664M |
0 |
| 11633 |
664M |
0 |