Query time 0.00168
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "69.05"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "7.84"
},
"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": 49,
"rows_produced_per_join": 7,
"filtered": "10.00",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (3695,3696,3697,3709,3710,3711,3712,3713,3714,3715,3716,3717,3718,3708,3152,25,1365,3138,3149,6719,3146,3150,1345,1346,1347,1348,1349,1350,1351,1352,1353,1354,3698,3699,3700,3701,3702,3703,3704,3705,3706,3707,6723,6717,6720,3151,3864,3145))",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "46.66",
"eval_cost": "0.78",
"prefix_cost": "59.20",
"data_read_per_join": "125"
},
"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": 7,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.23",
"eval_cost": "0.78",
"prefix_cost": "61.21",
"data_read_per_join": "125"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 25 |
273M |
|
| 1345 |
273M |
|
| 1346 |
273M |
|
| 1347 |
273M |
|
| 1348 |
273M |
|
| 1349 |
273M |
|
| 1350 |
273M |
|
| 1351 |
273M |
|
| 1352 |
273M |
|
| 1353 |
273M |
|
| 1354 |
273M |
|
| 1365 |
273M |
|
| 3138 |
273M |
|
| 3145 |
273M |
|
| 3146 |
273M |
|
| 3149 |
273M |
|
| 3150 |
273M |
|
| 3151 |
273M |
|
| 3152 |
273M |
|
| 3695 |
273M |
|
| 3696 |
273M |
|
| 3697 |
273M |
|
| 3698 |
273M |
|
| 3699 |
273M |
|
| 3700 |
273M |
|
| 3701 |
273M |
|
| 3702 |
273M |
|
| 3703 |
273M |
|
| 3704 |
273M |
|
| 3705 |
273M |
|
| 3706 |
273M |
|
| 3707 |
273M |
|
| 3708 |
273M |
|
| 3709 |
273M |
|
| 3710 |
273M |
|
| 3711 |
273M |
|
| 3712 |
273M |
|
| 3713 |
273M |
|
| 3714 |
273M |
|
| 3715 |
273M |
|
| 3716 |
273M |
|
| 3717 |
273M |
|
| 3718 |
273M |
|
| 3864 |
273M |
|
| 6717 |
273M |
|
| 6719 |
273M |
|
| 6720 |
273M |
|
| 6723 |
273M |
|