Query time 0.00103
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "68.13"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "7.68"
},
"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": 48,
"rows_produced_per_join": 7,
"filtered": "10.00",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (1462,1463,1464,1465,5170,5171,5172,5173,5174,5175,1878,1879,1880,1881,1882,1883,1884,1885,1886,1887,1888,1889,1890,1891,1892,1893,1894,1895,1896,1897,1898,1899,1900,1901,1902,1903,1904,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915))",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "46.10",
"eval_cost": "0.77",
"prefix_cost": "58.48",
"data_read_per_join": "122"
},
"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.20",
"eval_cost": "0.77",
"prefix_cost": "60.45",
"data_read_per_join": "122"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1462 |
308M |
|
| 1463 |
308M |
|
| 1464 |
308M |
|
| 1465 |
308M |
|
| 1878 |
308M |
|
| 1879 |
308M |
|
| 1880 |
308M |
|
| 1881 |
308M |
|
| 1882 |
308M |
|
| 1883 |
308M |
|
| 1884 |
308M |
|
| 1885 |
308M |
|
| 1886 |
308M |
|
| 1887 |
308M |
|
| 1888 |
308M |
|
| 1889 |
308M |
|
| 1890 |
308M |
|
| 1891 |
308M |
|
| 1892 |
308M |
|
| 1893 |
308M |
|
| 1894 |
308M |
|
| 1895 |
308M |
|
| 1896 |
308M |
|
| 1897 |
308M |
|
| 1898 |
308M |
|
| 1899 |
308M |
|
| 1900 |
308M |
|
| 1901 |
308M |
|
| 1902 |
308M |
|
| 1903 |
308M |
|
| 1904 |
308M |
|
| 1905 |
308M |
|
| 1906 |
308M |
|
| 1907 |
308M |
|
| 1908 |
308M |
|
| 1909 |
308M |
|
| 1910 |
308M |
|
| 1911 |
308M |
|
| 1912 |
308M |
|
| 1913 |
308M |
|
| 1914 |
308M |
|
| 1915 |
308M |
|
| 5170 |
308M |
|
| 5171 |
308M |
|
| 5172 |
308M |
|
| 5173 |
308M |
|
| 5174 |
308M |
|
| 5175 |
308M |
|