Query time 0.00147
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "71.41"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "8.32"
},
"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": 52,
"rows_produced_per_join": 8,
"filtered": "10.00",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (3484,3487,3485,3486,6969,3434,6947,3424,3911,3422,3910,3421,3909,3420,3423,3912,3914,3913,3433,3432,3135,3403,3404,3405,3406,3408,3409,6930,6931,6932,6933,6934,6935,6936,3407,2666,3845,2667,2668,2669,2670,3846,3847,3848,3849,3850,6258))",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "47.94",
"eval_cost": "0.83",
"prefix_cost": "60.96",
"data_read_per_join": "133"
},
"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.30",
"eval_cost": "0.83",
"prefix_cost": "63.09",
"data_read_per_join": "133"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 2666 |
309M |
|
| 2667 |
309M |
|
| 2668 |
309M |
|
| 2669 |
309M |
|
| 2670 |
309M |
|
| 3135 |
292M |
|
| 3403 |
292M |
|
| 3404 |
292M |
|
| 3405 |
292M |
|
| 3406 |
292M |
|
| 3407 |
292M |
|
| 3408 |
292M |
|
| 3409 |
292M |
|
| 3420 |
292M |
|
| 3421 |
292M |
|
| 3422 |
292M |
|
| 3423 |
292M |
|
| 3424 |
292M |
|
| 3432 |
300M |
|
| 3433 |
305M |
|
| 3434 |
303M |
|
| 3484 |
302M |
|
| 3485 |
302M |
|
| 3486 |
302M |
|
| 3487 |
302M |
|
| 3845 |
309M |
|
| 3846 |
309M |
|
| 3847 |
309M |
|
| 3848 |
309M |
|
| 3849 |
309M |
|
| 3850 |
309M |
|
| 3909 |
292M |
|
| 3910 |
292M |
|
| 3911 |
292M |
|
| 3912 |
292M |
|
| 3913 |
304M |
|
| 3914 |
304M |
|
| 6258 |
309M |
|
| 6930 |
292M |
|
| 6931 |
292M |
|
| 6932 |
292M |
|
| 6933 |
292M |
|
| 6934 |
292M |
|
| 6935 |
292M |
|
| 6936 |
292M |
|
| 6947 |
267,282,292M |
|
| 6969 |
303M |
|