Query time 0.00406
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "67.26"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "0.96"
},
"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 (1517,1518,1519,1520,1521,1522,1523,1524,1525,1537,1538,1539,1540,1541,1542,1543,1544,1545,2217,2218,2219,2735,2863,2864,3729,3732,5220,5221,5222,5223,5224,5225,5226,5227,5237,5238,5239,5240,5241,5242,5243,5244,5817,5818,5819,6322,6448,6449,7494,7495,7498,7499,7504,7505,7526,7527))",
"cost_info": {
"read_cost": "44.00",
"eval_cost": "0.10",
"prefix_cost": "66.30",
"data_read_per_join": "15"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
| 1517 |
308M |
| 1518 |
308M |
| 1519 |
308M |
| 1520 |
308M |
| 1521 |
308M |
| 1522 |
308M |
| 1523 |
308M |
| 1524 |
308M |
| 1525 |
308M |
| 1537 |
308M |
| 1538 |
308M |
| 1539 |
308M |
| 1540 |
308M |
| 1541 |
308M |
| 1542 |
308M |
| 1543 |
308M |
| 1544 |
308M |
| 1545 |
308M |
| 2217 |
308M |
| 2218 |
308M |
| 2219 |
308M |
| 2735 |
308M |
| 2863 |
308M |
| 2864 |
308M |
| 3729 |
308M |
| 3732 |
308M |
| 5220 |
308M |
| 5221 |
308M |
| 5222 |
308M |
| 5223 |
308M |
| 5224 |
308M |
| 5225 |
308M |
| 5226 |
308M |
| 5227 |
308M |
| 5237 |
308M |
| 5238 |
308M |
| 5239 |
308M |
| 5240 |
308M |
| 5241 |
308M |
| 5242 |
308M |
| 5243 |
308M |
| 5244 |
308M |
| 5817 |
308M |
| 5818 |
308M |
| 5819 |
308M |
| 6322 |
308M |
| 6448 |
308M |
| 6449 |
308M |
| 7494 |
308M |
| 7495 |
308M |
| 7498 |
308M |
| 7499 |
308M |
| 7504 |
308M |
| 7505 |
308M |
| 7526 |
308M |
| 7527 |
308M |