Query time 0.00112
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "121.47"
},
"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": 43,
"rows_produced_per_join": 43,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "9.67",
"eval_cost": "8.60",
"prefix_cost": "18.27",
"data_read_per_join": "688"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`webmarco`.`cscart_products_categories`.`product_id` in (82071,82118,82073,82038,149042,82061,81948,82009,82101,81647,82133,82103,81737,81655,82104,81704,81826,81863,81741,81860,81702,82072,81634,81657,81739,81625,82115,81776,82074,81611,81862,81627,82114,82069,81773,81636,81624,82099,82052,82096,81747,82116,82095))"
}
},
{
"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",
"webmarco.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 43,
"filtered": "100.00",
"cost_info": {
"read_cost": "43.00",
"eval_cost": "8.60",
"prefix_cost": "69.87",
"data_read_per_join": "688"
},
"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": [
"webmarco.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 2,
"filtered": "5.00",
"cost_info": {
"read_cost": "43.00",
"eval_cost": "0.43",
"prefix_cost": "121.47",
"data_read_per_join": "12K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`webmarco`.`cscart_categories`.`storefront_id` in (0,1)) and ((`webmarco`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`webmarco`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`webmarco`.`cscart_categories`.`usergroup_ids`)) and (`webmarco`.`cscart_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
product_id |
category_ids |
position |
81611 |
2905M |
|
81624 |
2904M |
|
81625 |
2904M |
|
81627 |
2904M |
|
81634 |
2904M |
|
81636 |
2904M |
|
81647 |
2904M |
|
81655 |
2904M |
|
81657 |
2904M |
|
81702 |
2904M |
|
81704 |
2904M |
|
81737 |
2904M |
|
81739 |
2904M |
|
81741 |
2904M |
|
81747 |
2904M |
|
81773 |
2904M |
|
81776 |
2904M |
|
81826 |
2904M |
|
81860 |
2904M |
|
81862 |
2904M |
|
81863 |
2904M |
|
81948 |
2904M |
|
82009 |
2904M |
|
82038 |
2904M |
|
82052 |
2904M |
|
82061 |
2904M |
|
82069 |
2904M |
|
82071 |
2904M |
|
82072 |
2904M |
|
82073 |
2904M |
|
82074 |
2904M |
|
82095 |
2904M |
|
82096 |
2904M |
|
82099 |
2904M |
|
82101 |
2904M |
|
82103 |
2904M |
|
82104 |
2904M |
|
82114 |
2904M |
|
82115 |
2904M |
|
82116 |
2904M |
|
82118 |
2904M |
|
82133 |
2904M |
|
149042 |
2904M |
|