SELECT 
  category_id, 
  parent_id 
FROM 
  categories 
WHERE 
  parent_id IN(
    14017, 15095, 15096, 14018, 14209, 14210, 
    14212, 14043, 13999, 14831, 14022, 
    14013, 14213, 15097, 14000, 15098, 
    14023, 14833, 14832, 14001, 14024, 
    15099, 14041, 15100, 15101, 14042, 
    14834, 14021, 14211, 15102, 14002, 
    14003, 15103, 14214, 15104, 14835, 
    14215, 14014, 14025, 15105, 15106, 
    14836, 14026, 14027, 15107, 14837, 
    14004, 14839, 14040, 14838, 14005, 
    14006, 14208, 14007, 14207, 14840, 
    15108, 14841, 14842, 14008, 15109, 
    14015, 14843, 14009, 14206, 14010, 
    15110, 14845, 15114, 15115, 15111, 
    15112, 14011, 14028, 15113, 14029, 
    13996, 13995, 14012, 13997, 14016, 
    13998, 14019, 14849, 14020
  )

Query time 0.00240

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "31.70"
    },
    "table": {
      "table_name": "categories",
      "access_type": "range",
      "possible_keys": [
        "parent"
      ],
      "key": "parent",
      "used_key_parts": [
        "parent_id"
      ],
      "key_length": "3",
      "rows_examined_per_scan": 155,
      "rows_produced_per_join": 155,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "16.21",
        "eval_cost": "15.50",
        "prefix_cost": "31.71",
        "data_read_per_join": "405K"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`goimagine`.`categories`.`parent_id` in (14017,15095,15096,14018,14209,14210,14212,14043,13999,14831,14022,14013,14213,15097,14000,15098,14023,14833,14832,14001,14024,15099,14041,15100,15101,14042,14834,14021,14211,15102,14002,14003,15103,14214,15104,14835,14215,14014,14025,15105,15106,14836,14026,14027,15107,14837,14004,14839,14040,14838,14005,14006,14208,14007,14207,14840,15108,14841,14842,14008,15109,14015,14843,14009,14206,14010,15110,14845,15114,15115,15111,15112,14011,14028,15113,14029,13996,13995,14012,13997,14016,13998,14019,14849,14020))"
    }
  }
}

Result

category_id parent_id
13996 13995
13997 13995
13998 13995
13999 13996
14001 13996
14002 13996
14006 13996
14008 13996
14010 13996
15102 13996
15114 13996
14000 13997
14003 13997
14004 13997
14005 13997
14009 13997
14011 13997
15107 13997
15115 13997
14007 13998
15098 13998
15101 13998
14013 14012
14014 14012
14015 14012
15103 14012
14017 14016
14018 14016
15099 14016
14022 14019
14023 14019
14024 14019
14025 14019
14026 14019
14027 14019
14028 14019
14029 14019
14042 14019
14832 14019
14834 14019
14835 14019
14836 14019
14837 14019
14838 14019
14839 14019
14840 14019
14841 14019
14842 14019
14843 14019
14845 14019
15096 14019
15097 14019
15100 14019
15104 14019
15105 14019
15106 14019
15109 14019
15110 14019
15111 14019
15112 14019
14041 14020
14214 14020
14021 14849
14040 14849
14043 14849
14206 14849
14207 14849
14208 14849
14209 14849
14210 14849
14211 14849
14212 14849
14213 14849
14215 14849
14831 14849
14833 14849
15095 14849
15108 14849
15113 14849