Query time 0.00288
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "67.24"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "0.94"
},
"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": 0,
"filtered": "0.54",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (514,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,1515,1516,1526,1527,1528,1529,1530,1531,1532,1533,1534,1535,1536,3675,3727,3728,3730,3731,5210,5211,5212,5213,5214,5215,5216,5217,5218,5219,5228,5229,5230,5231,5232,5233,5234,5235,5236,7496,7497,7500,7501,7506,7507,7528,7529))",
"cost_info": {
"read_cost": "44.00",
"eval_cost": "0.09",
"prefix_cost": "66.30",
"data_read_per_join": "15"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
| 514 |
308M |
| 1505 |
308M |
| 1506 |
308M |
| 1507 |
308M |
| 1508 |
308M |
| 1509 |
308M |
| 1510 |
308M |
| 1511 |
308M |
| 1512 |
308M |
| 1513 |
308M |
| 1514 |
308M |
| 1515 |
308M |
| 1516 |
308M |
| 1526 |
308M |
| 1527 |
308M |
| 1528 |
308M |
| 1529 |
308M |
| 1530 |
308M |
| 1531 |
308M |
| 1532 |
308M |
| 1533 |
308M |
| 1534 |
308M |
| 1535 |
308M |
| 1536 |
308M |
| 3675 |
308M |
| 3727 |
308M |
| 3728 |
308M |
| 3730 |
308M |
| 3731 |
308M |
| 5210 |
308M |
| 5211 |
308M |
| 5212 |
308M |
| 5213 |
308M |
| 5214 |
308M |
| 5215 |
308M |
| 5216 |
308M |
| 5217 |
308M |
| 5218 |
308M |
| 5219 |
308M |
| 5228 |
308M |
| 5229 |
308M |
| 5230 |
308M |
| 5231 |
308M |
| 5232 |
308M |
| 5233 |
308M |
| 5234 |
308M |
| 5235 |
308M |
| 5236 |
308M |
| 7496 |
308M |
| 7497 |
308M |
| 7500 |
308M |
| 7501 |
308M |
| 7506 |
308M |
| 7507 |
308M |
| 7528 |
308M |
| 7529 |
308M |