Query time 0.00255
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "68.52"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "1.64"
},
"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.93",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (2013,2014,2015,2016,2017,2018,2019,2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,2030,2031,2032,2033,2034,2035,2036,2037,2038,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,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))",
"cost_info": {
"read_cost": "44.00",
"eval_cost": "0.16",
"prefix_cost": "66.30",
"data_read_per_join": "26"
},
"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.41",
"eval_cost": "0.16",
"prefix_cost": "66.88",
"data_read_per_join": "26"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1467 |
308M |
|
| 1468 |
308M |
|
| 1469 |
308M |
|
| 1470 |
308M |
|
| 1471 |
308M |
|
| 1479 |
308M |
|
| 1480 |
308M |
|
| 1481 |
308M |
|
| 1482 |
308M |
|
| 1483 |
308M |
|
| 2013 |
308M |
|
| 2014 |
308M |
|
| 2015 |
308M |
|
| 2016 |
308M |
|
| 2017 |
308M |
|
| 2018 |
308M |
|
| 2019 |
308M |
|
| 2020 |
308M |
|
| 2021 |
308M |
|
| 2022 |
308M |
|
| 2023 |
308M |
|
| 2024 |
308M |
|
| 2025 |
308M |
|
| 2026 |
308M |
|
| 2027 |
308M |
|
| 2028 |
308M |
|
| 2029 |
308M |
|
| 2030 |
308M |
|
| 2031 |
308M |
|
| 2032 |
308M |
|
| 2033 |
308M |
|
| 2034 |
308M |
|
| 2035 |
308M |
|
| 2036 |
308M |
|
| 2037 |
308M |
|
| 2038 |
308M |
|
| 5188 |
308M |
|
| 5189 |
308M |
|
| 5190 |
308M |
|
| 5191 |
308M |
|
| 5192 |
308M |
|
| 5193 |
308M |
|
| 5668 |
308M |
|
| 5669 |
308M |
|
| 5670 |
308M |
|
| 5671 |
308M |
|
| 5672 |
308M |
|
| 5673 |
308M |
|
| 5674 |
308M |
|
| 5675 |
308M |
|
| 5676 |
308M |
|
| 5677 |
308M |
|
| 5678 |
308M |
|
| 5679 |
308M |
|
| 5680 |
308M |
|
| 5681 |
308M |
|
| 5682 |
308M |
|
| 5683 |
308M |
|
| 5684 |
308M |
|
| 5685 |
308M |
|
| 5686 |
308M |
|
| 5687 |
308M |
|
| 5688 |
308M |
|
| 5689 |
308M |
|
| 5690 |
308M |
|
| 5691 |
308M |
|
| 5692 |
308M |
|
| 5693 |
308M |
|
| 5694 |
308M |
|
| 5695 |
308M |
|
| 5696 |
308M |
|
| 5697 |
308M |
|
| 5698 |
308M |
|
| 5699 |
308M |
|
| 5700 |
308M |
|
| 5701 |
308M |
|
| 5702 |
308M |
|
| 5703 |
308M |
|
| 5704 |
308M |
|
| 5705 |
308M |
|
| 5706 |
308M |
|
| 5707 |
308M |
|
| 5708 |
308M |
|
| 5709 |
308M |
|
| 5710 |
308M |
|
| 5711 |
308M |
|
| 5712 |
308M |
|
| 5713 |
308M |
|
| 5714 |
308M |
|
| 5715 |
308M |
|
| 5716 |
308M |
|
| 5717 |
308M |
|
| 5718 |
308M |
|
| 5719 |
308M |
|
| 5720 |
308M |
|
| 5721 |
308M |
|