Query time 0.00376
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "26.39"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "1.10"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 59,
"rows_produced_per_join": 2,
"filtered": "4.00",
"cost_info": {
"read_cost": "6.76",
"eval_cost": "0.24",
"prefix_cost": "7.00",
"data_read_per_join": "10K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`testdobroded`.`cscart_categories`.`storefront_id` in (0,1)) and ((`testdobroded`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`testdobroded`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`testdobroded`.`cscart_categories`.`usergroup_ids`))) and (`testdobroded`.`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": [
"testdobroded.cscart_categories.category_id"
],
"rows_examined_per_scan": 25,
"rows_produced_per_join": 1,
"filtered": "1.86",
"index_condition": "(`testdobroded`.`cscart_products_categories`.`product_id` in (27,23,160,24,159,568,1439,1438,1440,1441,1449,1560,1448,1450,1561,1562,1572,1573,1574))",
"cost_info": {
"read_cost": "12.01",
"eval_cost": "0.11",
"prefix_cost": "24.91",
"data_read_per_join": "17"
},
"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",
"testdobroded.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.27",
"eval_cost": "0.11",
"prefix_cost": "25.29",
"data_read_per_join": "17"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 23 |
6M |
0 |
| 24 |
6M |
0 |
| 27 |
6M |
0 |
| 159 |
6M |
0 |
| 160 |
6M |
0 |
| 568 |
6M |
0 |
| 1438 |
19M,6 |
0 |
| 1439 |
19M,6 |
0 |
| 1440 |
19M,6 |
0 |
| 1441 |
19M,6 |
0 |
| 1448 |
19M,6 |
0 |
| 1449 |
19M,6 |
0 |
| 1450 |
6,19M |
0 |
| 1560 |
6M |
0 |
| 1561 |
6M |
0 |
| 1562 |
6M |
0 |
| 1572 |
6M,74 |
0 |
| 1573 |
6M,74 |
0 |
| 1574 |
6M,74 |
0 |