Query time 0.00262
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "68.48"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "1.61"
},
"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": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"gaseus.cscart_categories.category_id"
],
"rows_examined_per_scan": 110,
"rows_produced_per_join": 1,
"filtered": "0.92",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (5690,5691,5692,5693,5694,5695,5696,5697,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712,5713,5714,5715,5716,5717,5718,5719,5720,5721,1479,1480,1481,1482,1483,5188,5189,5190,5191,5192,5193,1467,1468,1469,1470,1471,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))",
"cost_info": {
"read_cost": "44.00",
"eval_cost": "0.16",
"prefix_cost": "66.30",
"data_read_per_join": "25"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"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": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.40",
"eval_cost": "0.16",
"prefix_cost": "66.87",
"data_read_per_join": "25"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 447 |
308M |
0 |
| 448 |
308M |
0 |
| 449 |
308M |
0 |
| 450 |
308M |
0 |
| 451 |
308M |
0 |
| 452 |
308M |
0 |
| 453 |
308M |
0 |
| 454 |
308M |
0 |
| 455 |
308M |
0 |
| 1467 |
308M |
0 |
| 1468 |
308M |
0 |
| 1469 |
308M |
0 |
| 1470 |
308M |
0 |
| 1471 |
308M |
0 |
| 1479 |
308M |
0 |
| 1480 |
308M |
0 |
| 1481 |
308M |
0 |
| 1482 |
308M |
0 |
| 1483 |
308M |
0 |
| 1932 |
308M |
0 |
| 1933 |
308M |
0 |
| 1934 |
308M |
0 |
| 1935 |
308M |
0 |
| 1936 |
308M |
0 |
| 1937 |
308M |
0 |
| 1938 |
308M |
0 |
| 1939 |
308M |
0 |
| 1940 |
308M |
0 |
| 1941 |
308M |
0 |
| 1942 |
308M |
0 |
| 1943 |
308M |
0 |
| 1944 |
308M |
0 |
| 1945 |
308M |
0 |
| 1946 |
308M |
0 |
| 1947 |
308M |
0 |
| 1948 |
308M |
0 |
| 1949 |
308M |
0 |
| 1950 |
308M |
0 |
| 1951 |
308M |
0 |
| 1952 |
308M |
0 |
| 1953 |
308M |
0 |
| 1954 |
308M |
0 |
| 1955 |
308M |
0 |
| 1956 |
308M |
0 |
| 1957 |
308M |
0 |
| 1958 |
308M |
0 |
| 1959 |
308M |
0 |
| 1960 |
308M |
0 |
| 1961 |
308M |
0 |
| 1962 |
308M |
0 |
| 1963 |
308M |
0 |
| 1964 |
308M |
0 |
| 5176 |
308M |
0 |
| 5177 |
308M |
0 |
| 5178 |
308M |
0 |
| 5179 |
308M |
0 |
| 5180 |
308M |
0 |
| 5181 |
308M |
0 |
| 5188 |
308M |
0 |
| 5189 |
308M |
0 |
| 5190 |
308M |
0 |
| 5191 |
308M |
0 |
| 5192 |
308M |
0 |
| 5193 |
308M |
0 |
| 5690 |
308M |
0 |
| 5691 |
308M |
0 |
| 5692 |
308M |
0 |
| 5693 |
308M |
0 |
| 5694 |
308M |
0 |
| 5695 |
308M |
0 |
| 5696 |
308M |
0 |
| 5697 |
308M |
0 |
| 5698 |
308M |
0 |
| 5699 |
308M |
0 |
| 5700 |
308M |
0 |
| 5701 |
308M |
0 |
| 5702 |
308M |
0 |
| 5703 |
308M |
0 |
| 5704 |
308M |
0 |
| 5705 |
308M |
0 |
| 5706 |
308M |
0 |
| 5707 |
308M |
0 |
| 5708 |
308M |
0 |
| 5709 |
308M |
0 |
| 5710 |
308M |
0 |
| 5711 |
308M |
0 |
| 5712 |
308M |
0 |
| 5713 |
308M |
0 |
| 5714 |
308M |
0 |
| 5715 |
308M |
0 |
| 5716 |
308M |
0 |
| 5717 |
308M |
0 |
| 5718 |
308M |
0 |
| 5719 |
308M |
0 |
| 5720 |
308M |
0 |
| 5721 |
308M |
0 |