Query time 0.00122
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "30.15"
},
"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": 33,
"rows_produced_per_join": 33,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "3.76",
"eval_cost": "3.30",
"prefix_cost": "7.06",
"data_read_per_join": "528"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`cscart_db`.`cscart_products_categories`.`product_id` in (26051,26250,27074,28333,28335,28338,30025,30061,30873,30874,30875,30876,30877,30878,30879,30880,30930,30976,30977,31316,31558,31560,31561,31784))"
}
},
{
"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",
"cscart_db.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 33,
"filtered": "100.00",
"cost_info": {
"read_cost": "8.25",
"eval_cost": "3.30",
"prefix_cost": "18.61",
"data_read_per_join": "528"
},
"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": [
"cscart_db.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "8.25",
"eval_cost": "0.17",
"prefix_cost": "30.16",
"data_read_per_join": "4K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`cscart_db`.`cscart_categories`.`storefront_id` in (0,1)) and ((`cscart_db`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`cscart_db`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`cscart_db`.`cscart_categories`.`usergroup_ids`))) and (`cscart_db`.`cscart_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 26051 |
1952,2825M |
|
| 26250 |
2334,2695M |
|
| 27074 |
2693M |
|
| 28333 |
2826M |
|
| 28335 |
2693M |
|
| 28338 |
2693M |
|
| 30025 |
2334,2695M |
|
| 30061 |
2334,2826M |
|
| 30873 |
2826M |
|
| 30874 |
2826M |
|
| 30875 |
2695M |
|
| 30876 |
2695M |
|
| 30877 |
2695M |
|
| 30878 |
2695M |
|
| 30879 |
2695M |
|
| 30880 |
2695M |
|
| 30930 |
2695M |
|
| 30976 |
2826M |
|
| 30977 |
2825M |
|
| 31316 |
2334,2695M |
|
| 31558 |
2334,2695M |
|
| 31560 |
2334,2695M |
|
| 31561 |
2334,2695M |
|
| 31784 |
2334,2695M |
|