Query time 0.00120
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "71.81"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "8.32"
},
"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": 52,
"rows_produced_per_join": 8,
"filtered": "10.00",
"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))",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "48.34",
"eval_cost": "0.83",
"prefix_cost": "61.36",
"data_read_per_join": "133"
},
"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.30",
"eval_cost": "0.83",
"prefix_cost": "63.49",
"data_read_per_join": "133"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 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 |
| 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 |