Query time 0.00344
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "69.17"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "2.12"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 40,
"rows_produced_per_join": 1,
"filtered": "4.00",
"cost_info": {
"read_cost": "4.54",
"eval_cost": "0.16",
"prefix_cost": "4.70",
"data_read_per_join": "6K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`gaseus`.`cscart_categories`.`storefront_id` in (0,1)) and ((`gaseus`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`gaseus`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`gaseus`.`cscart_categories`.`usergroup_ids`))) and (`gaseus`.`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": [
"gaseus.cscart_categories.category_id"
],
"rows_examined_per_scan": 110,
"rows_produced_per_join": 2,
"filtered": "1.21",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (6962,6966,6967,6965,6963,6952,6953,6947,6959,3425,6958,6960,6968,6961,6964,6957,6956,6954,6955,6948,6950,6949,6946,6945,3414,6938,6941,6944,3412,6937,6939,6943,6970,6971,6972,6973,6974,6975))",
"cost_info": {
"read_cost": "44.00",
"eval_cost": "0.21",
"prefix_cost": "66.30",
"data_read_per_join": "33"
},
"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",
"gaseus.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 2,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.53",
"eval_cost": "0.21",
"prefix_cost": "67.05",
"data_read_per_join": "33"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 3412 |
282,267,288M |
0 |
| 3414 |
282,267,288M |
0 |
| 3425 |
282,267,284M,312 |
0 |
| 6937 |
282,267,288M |
0 |
| 6938 |
282,267,288M |
0 |
| 6939 |
282,267,288M |
0 |
| 6941 |
282,267,288M |
0 |
| 6943 |
282,267,288M |
0 |
| 6944 |
282,267,288M |
0 |
| 6945 |
282,267,288M |
0 |
| 6946 |
282,267,288M |
0 |
| 6947 |
292M,282,267 |
0 |
| 6948 |
282,272M,267 |
0 |
| 6949 |
282,272M,267 |
0 |
| 6950 |
282,272M,267 |
0 |
| 6952 |
282,267,301M |
0 |
| 6953 |
282,267,301M |
0 |
| 6954 |
282,267,301M |
0 |
| 6955 |
282,267,301M |
0 |
| 6956 |
282,267,301M |
0 |
| 6957 |
282,267,301M |
0 |
| 6958 |
282,267,284M,312 |
0 |
| 6959 |
282,267,284M,312 |
0 |
| 6960 |
282,267,284M,312 |
0 |
| 6961 |
283,282M,267 |
0 |
| 6962 |
283,282M,267 |
0 |
| 6963 |
283,282M,267 |
0 |
| 6964 |
283,282M,267 |
0 |
| 6965 |
283,282M,267 |
0 |
| 6966 |
283,282M,267 |
0 |
| 6967 |
283,282M,267 |
0 |
| 6968 |
283M,282,267 |
0 |
| 6970 |
282,267,284M,312 |
0 |
| 6971 |
282,267,284M,312 |
0 |
| 6972 |
282,267,284M,312 |
0 |
| 6973 |
282,267,284M,312 |
0 |
| 6974 |
282,267,284M,312 |
0 |
| 6975 |
282,267,284M,312 |
0 |