Query time 0.00122
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "70.89"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "8.16"
},
"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": 51,
"rows_produced_per_join": 8,
"filtered": "10.00",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (5754,5755,5756,5757,5758,5759,5760,5761,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776,5777,5778,5779,5780,5781,5782,5783,5784,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002))",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "47.78",
"eval_cost": "0.82",
"prefix_cost": "60.64",
"data_read_per_join": "130"
},
"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.28",
"eval_cost": "0.82",
"prefix_cost": "62.73",
"data_read_per_join": "130"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1986 |
308M |
|
| 1987 |
308M |
|
| 1988 |
308M |
|
| 1989 |
308M |
|
| 1990 |
308M |
|
| 1991 |
308M |
|
| 1992 |
308M |
|
| 1993 |
308M |
|
| 1994 |
308M |
|
| 1995 |
308M |
|
| 1996 |
308M |
|
| 1997 |
308M |
|
| 1998 |
308M |
|
| 1999 |
308M |
|
| 2000 |
308M |
|
| 2001 |
308M |
|
| 2002 |
308M |
|
| 5754 |
308M |
|
| 5755 |
308M |
|
| 5756 |
308M |
|
| 5757 |
308M |
|
| 5758 |
308M |
|
| 5759 |
308M |
|
| 5760 |
308M |
|
| 5761 |
308M |
|
| 5762 |
308M |
|
| 5763 |
308M |
|
| 5764 |
308M |
|
| 5765 |
308M |
|
| 5766 |
308M |
|
| 5767 |
308M |
|
| 5768 |
308M |
|
| 5769 |
308M |
|
| 5770 |
308M |
|
| 5771 |
308M |
|
| 5772 |
308M |
|
| 5773 |
308M |
|
| 5774 |
308M |
|
| 5775 |
308M |
|
| 5776 |
308M |
|
| 5777 |
308M |
|
| 5778 |
308M |
|
| 5779 |
308M |
|
| 5780 |
308M |
|
| 5781 |
308M |
|
| 5782 |
308M |
|
| 5783 |
308M |
|
| 5784 |
308M |
|