SELECT 
  category_id, 
  parent_id 
FROM 
  categories 
WHERE 
  parent_id IN(
    18764, 18762, 18763, 18789, 18784, 17807, 
    18778, 17808, 18779, 18788, 18664, 
    18646, 18634, 19114, 19011, 18766, 
    18790, 18785, 18769, 18667, 18725, 
    18711, 18696, 18693, 18690, 18684, 
    18681, 17805, 18759, 18773, 18774, 
    18635, 18645, 18760, 18786, 19414, 
    18663, 18682, 18732, 18726, 18723, 
    18720, 18712, 18709, 18703, 18700, 
    18697, 18694, 18691, 18688, 18685, 
    18782, 18641, 18636, 18642, 18727, 
    17804, 19113, 18761, 18637, 18643, 
    18772, 18746, 18638, 18647, 18783, 
    18639, 18649, 18644, 18640, 18650, 
    18753, 18648, 18651, 18781, 18652, 
    18765, 18653, 18758, 18654, 18776, 
    18655, 18656, 18662, 18659, 18658, 
    18730, 18660, 18661
  )

Query time 0.00117

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "33.71"
    },
    "table": {
      "table_name": "categories",
      "access_type": "range",
      "possible_keys": [
        "parent"
      ],
      "key": "parent",
      "used_key_parts": [
        "parent_id"
      ],
      "key_length": "3",
      "rows_examined_per_scan": 165,
      "rows_produced_per_join": 165,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "17.21",
        "eval_cost": "16.50",
        "prefix_cost": "33.71",
        "data_read_per_join": "431K"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`goimagine`.`categories`.`parent_id` in (18764,18762,18763,18789,18784,17807,18778,17808,18779,18788,18664,18646,18634,19114,19011,18766,18790,18785,18769,18667,18725,18711,18696,18693,18690,18684,18681,17805,18759,18773,18774,18635,18645,18760,18786,19414,18663,18682,18732,18726,18723,18720,18712,18709,18703,18700,18697,18694,18691,18688,18685,18782,18641,18636,18642,18727,17804,19113,18761,18637,18643,18772,18746,18638,18647,18783,18639,18649,18644,18640,18650,18753,18648,18651,18781,18652,18765,18653,18758,18654,18776,18655,18656,18662,18659,18658,18730,18660,18661))"
    }
  }
}

Result

category_id parent_id
18663 17804
18667 17804
18641 17805
18649 17805
18650 17805
18651 17805
18652 17805
18653 17805
18654 17805
18655 17805
18656 17805
18657 17805
18658 17805
18659 17805
18660 17805
18661 17805
18662 17805
18730 17805
18734 17805
18735 17805
18746 17805
18761 17805
19011 17805
17808 17807
17809 17807
18642 18641
18643 18641
18644 18641
18645 18641
18646 18641
18647 18641
18648 18641
18762 18641
18763 18641
19113 18643
19114 18643
19414 18643
18681 18649
18682 18649
18683 18649
18684 18650
18685 18650
18686 18650
18687 18651
18688 18651
18689 18651
18690 18652
18691 18652
18692 18652
18693 18653
18694 18653
18695 18653
18696 18654
18697 18654
18698 18654
18699 18655
18700 18655
18701 18655
18702 18656
18703 18656
18704 18656
18719 18658
18720 18658
18721 18658
18711 18659
18712 18659
18713 18659
18722 18660
18723 18660
18724 18660
18725 18661
18726 18661
18727 18661
18708 18662
18709 18662
18710 18662
18634 18664
18635 18664
18636 18664
18637 18664
18638 18664
18639 18664
18640 18664
18731 18730
18732 18730
18733 18730
18759 18758
18760 18758
18769 18765
18770 18765
18771 18765
18766 18769
18767 18769
18768 18769
18785 18772
18786 18772
18778 18773
18779 18773
18780 18773
18782 18781
18790 18781
18784 18783
18788 18783
18764 19011