Query time 0.00300
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "61.38"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "1.92"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 46,
"rows_produced_per_join": 1,
"filtered": "4.00",
"cost_info": {
"read_cost": "5.15",
"eval_cost": "0.18",
"prefix_cost": "5.33",
"data_read_per_join": "7K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`test2_gaseus`.`cscart_categories`.`storefront_id` in (0,1)) and ((`test2_gaseus`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`test2_gaseus`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`test2_gaseus`.`cscart_categories`.`usergroup_ids`))) and (`test2_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": [
"test2_gaseus.cscart_categories.category_id"
],
"rows_examined_per_scan": 83,
"rows_produced_per_join": 1,
"filtered": "1.26",
"index_condition": "(`test2_gaseus`.`cscart_products_categories`.`product_id` in (1818,1819,3744,3745,3746,3747,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472,5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488,5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504,5163,5153,1419,1420,1421,3157,5132,5133,5134,5135,1452,5161,1442,5151,6734,6733,6729,6710,1721,1722,1723,1724,1725,1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740,1741,1742,1743,1744,1745,1746,1747,1748))",
"cost_info": {
"read_cost": "38.18",
"eval_cost": "0.19",
"prefix_cost": "58.78",
"data_read_per_join": "30"
},
"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",
"test2_gaseus.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.48",
"eval_cost": "0.19",
"prefix_cost": "59.46",
"data_read_per_join": "30"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1419 |
308M |
|
| 1420 |
308M |
|
| 1421 |
308M |
|
| 1442 |
308M |
|
| 1452 |
308M |
|
| 1721 |
308M |
|
| 1722 |
308M |
|
| 1723 |
308M |
|
| 1724 |
308M |
|
| 1725 |
308M |
|
| 1726 |
308M |
|
| 1727 |
308M |
|
| 1728 |
308M |
|
| 1729 |
308M |
|
| 1730 |
308M |
|
| 1731 |
308M |
|
| 1732 |
308M |
|
| 1733 |
308M |
|
| 1734 |
308M |
|
| 1735 |
308M |
|
| 1736 |
308M |
|
| 1737 |
308M |
|
| 1738 |
308M |
|
| 1739 |
308M |
|
| 1740 |
308M |
|
| 1741 |
308M |
|
| 1742 |
308M |
|
| 1743 |
308M |
|
| 1744 |
308M |
|
| 1745 |
308M |
|
| 1746 |
308M |
|
| 1747 |
308M |
|
| 1748 |
308M |
|
| 1818 |
308M |
|
| 1819 |
308M |
|
| 3157 |
308M |
|
| 3744 |
308M |
|
| 3745 |
308M |
|
| 3746 |
308M |
|
| 3747 |
308M |
|
| 5132 |
308M |
|
| 5133 |
308M |
|
| 5134 |
308M |
|
| 5135 |
308M |
|
| 5151 |
308M |
|
| 5153 |
308M |
|
| 5161 |
308M |
|
| 5163 |
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 |
|
| 5474 |
308M |
|
| 5475 |
308M |
|
| 5476 |
308M |
|
| 5477 |
308M |
|
| 5478 |
308M |
|
| 5479 |
308M |
|
| 5480 |
308M |
|
| 5481 |
308M |
|
| 5482 |
308M |
|
| 5483 |
308M |
|
| 5484 |
308M |
|
| 5485 |
308M |
|
| 5486 |
308M |
|
| 5487 |
308M |
|
| 5488 |
308M |
|
| 5489 |
308M |
|
| 5490 |
308M |
|
| 5491 |
308M |
|
| 5492 |
308M |
|
| 5493 |
308M |
|
| 5494 |
308M |
|
| 5495 |
308M |
|
| 5496 |
308M |
|
| 5497 |
308M |
|
| 5498 |
308M |
|
| 5499 |
308M |
|
| 5500 |
308M |
|
| 5501 |
308M |
|
| 5502 |
308M |
|
| 5503 |
308M |
|
| 5504 |
308M |
|
| 6710 |
308M |
|
| 6729 |
308M |
|
| 6733 |
308M |
|
| 6734 |
308M |
|