Query time 0.00151
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 (5176,5177,5178,5179,5180,5181,447,448,449,450,451,452,453,454,455,1932,1933,1934,1935,1936,1937,1938,1939,1940,1941,1942,1943,1944,1945,1946,1947,1948,1949,1950,1951,1952,1953,1954,1955,1956,1957,1958,1959,1960,1961,1962,1963,1964))",
"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 |
| 447 |
308M |
|
| 448 |
308M |
|
| 449 |
308M |
|
| 450 |
308M |
|
| 451 |
308M |
|
| 452 |
308M |
|
| 453 |
308M |
|
| 454 |
308M |
|
| 455 |
308M |
|
| 1932 |
308M |
|
| 1933 |
308M |
|
| 1934 |
308M |
|
| 1935 |
308M |
|
| 1936 |
308M |
|
| 1937 |
308M |
|
| 1938 |
308M |
|
| 1939 |
308M |
|
| 1940 |
308M |
|
| 1941 |
308M |
|
| 1942 |
308M |
|
| 1943 |
308M |
|
| 1944 |
308M |
|
| 1945 |
308M |
|
| 1946 |
308M |
|
| 1947 |
308M |
|
| 1948 |
308M |
|
| 1949 |
308M |
|
| 1950 |
308M |
|
| 1951 |
308M |
|
| 1952 |
308M |
|
| 1953 |
308M |
|
| 1954 |
308M |
|
| 1955 |
308M |
|
| 1956 |
308M |
|
| 1957 |
308M |
|
| 1958 |
308M |
|
| 1959 |
308M |
|
| 1960 |
308M |
|
| 1961 |
308M |
|
| 1962 |
308M |
|
| 1963 |
308M |
|
| 1964 |
308M |
|
| 5176 |
308M |
|
| 5177 |
308M |
|
| 5178 |
308M |
|
| 5179 |
308M |
|
| 5180 |
308M |
|
| 5181 |
308M |
|