Query time 0.00107
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 (1789,1790,1791,1792,1793,1794,1795,1796,1797,1798,1799,1800,1801,1802,1803,1804,1805,1806,1807,1808,1809,1810,1811,1812,1813,1814,1815,1816,1817,1818,1819,3744,3745,3746,3747,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473))",
"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 |
| 1789 |
308M |
|
| 1790 |
308M |
|
| 1791 |
308M |
|
| 1792 |
308M |
|
| 1793 |
308M |
|
| 1794 |
308M |
|
| 1795 |
308M |
|
| 1796 |
308M |
|
| 1797 |
308M |
|
| 1798 |
308M |
|
| 1799 |
308M |
|
| 1800 |
308M |
|
| 1801 |
308M |
|
| 1802 |
308M |
|
| 1803 |
308M |
|
| 1804 |
308M |
|
| 1805 |
308M |
|
| 1806 |
308M |
|
| 1807 |
308M |
|
| 1808 |
308M |
|
| 1809 |
308M |
|
| 1810 |
308M |
|
| 1811 |
308M |
|
| 1812 |
308M |
|
| 1813 |
308M |
|
| 1814 |
308M |
|
| 1815 |
308M |
|
| 1816 |
308M |
|
| 1817 |
308M |
|
| 1818 |
308M |
|
| 1819 |
308M |
|
| 3744 |
308M |
|
| 3745 |
308M |
|
| 3746 |
308M |
|
| 3747 |
308M |
|
| 5461 |
308M |
|
| 5462 |
308M |
|
| 5463 |
308M |
|
| 5464 |
308M |
|
| 5465 |
308M |
|
| 5466 |
308M |
|
| 5467 |
308M |
|
| 5468 |
308M |
|
| 5469 |
308M |
|
| 5470 |
308M |
|
| 5471 |
308M |
|
| 5472 |
308M |
|
| 5473 |
308M |
|