Query time 0.00127
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "73.65"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "8.64"
},
"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": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 54,
"rows_produced_per_join": 8,
"filtered": "10.00",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (10065,10066,10067,10068,10069,10070,10071,10072,10073,10074,10075,10076,10077,10078,10079,10080,10081,10082,10083,10084,10085,10086,10087,10088,10089,10090,10091,10092,10093,10094,10095,10096,10097,10098,10099,10100,10101,10102,10103,10104,10105,10106,10107,10108,10109,10110,10111,10420))",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "49.46",
"eval_cost": "0.86",
"prefix_cost": "62.80",
"data_read_per_join": "138"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`gaseus`.`cscart_products_categories`.`category_id` = `gaseus`.`cscart_categories`.`category_id`)"
}
},
{
"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": 8,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.35",
"eval_cost": "0.86",
"prefix_cost": "65.01",
"data_read_per_join": "138"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 10065 |
306M |
|
| 10066 |
306M |
|
| 10067 |
306M |
|
| 10068 |
306M |
|
| 10069 |
306M |
|
| 10070 |
306M |
|
| 10071 |
306M |
|
| 10072 |
306M |
|
| 10073 |
306M |
|
| 10074 |
306M |
|
| 10075 |
306M |
|
| 10076 |
306M |
|
| 10077 |
306M |
|
| 10078 |
306M |
|
| 10079 |
306M |
|
| 10080 |
306M |
|
| 10081 |
306M |
|
| 10082 |
306M |
|
| 10083 |
306M |
|
| 10084 |
306M |
|
| 10085 |
306M |
|
| 10086 |
306M |
|
| 10087 |
306M |
|
| 10088 |
306M |
|
| 10089 |
306M |
|
| 10090 |
306M |
|
| 10091 |
306M |
|
| 10092 |
306M |
|
| 10093 |
306M |
|
| 10094 |
306M |
|
| 10095 |
306M |
|
| 10096 |
306M |
|
| 10097 |
306M |
|
| 10098 |
306M |
|
| 10099 |
306M |
|
| 10100 |
306M |
|
| 10101 |
306M |
|
| 10102 |
306M |
|
| 10103 |
306M |
|
| 10104 |
306M |
|
| 10105 |
306M |
|
| 10106 |
306M |
|
| 10107 |
306M |
|
| 10108 |
306M |
|
| 10109 |
306M |
|
| 10110 |
306M |
|
| 10111 |
306M |
|
| 10420 |
306M |
|