SELECT 
  category_id, 
  parent_id 
FROM 
  categories 
WHERE 
  parent_id IN(
    2952, 2977, 3007, 3008, 2995, 2929, 2984, 
    3015, 3016, 2922, 2985, 2986, 2919, 
    2971, 2988, 3009, 3010, 2949, 3011, 
    3012, 3014, 2947, 2982, 2990, 11373, 
    2920, 2973, 11372, 2951, 2987, 11374, 
    2950, 2930, 2946, 2981, 2898, 2921, 
    2972, 11369, 2927, 2989, 3017, 3018, 
    2529, 7760, 2901, 2894, 2909, 2963, 
    2900, 2528, 2911, 2964, 2895, 2896, 
    2913, 2965, 2530, 2890, 2531, 2914, 
    2966, 2893, 2532, 2899, 2892, 2968, 
    2970, 2902, 2932, 2891, 2956, 2944, 
    2991, 2992, 2974, 2918, 2967, 2916, 
    2903, 2978, 2915, 2904, 2948, 2962, 
    2928, 2957, 2943, 2975, 2917, 2969, 
    2953, 2960, 2945, 2980, 2983, 2954, 
    2961, 2955, 2979, 2959, 2958, 2994, 
    2993
  )

Query time 0.00131

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "38.28"
    },
    "table": {
      "table_name": "categories",
      "access_type": "range",
      "possible_keys": [
        "parent"
      ],
      "key": "parent",
      "used_key_parts": [
        "parent_id"
      ],
      "key_length": "3",
      "rows_examined_per_scan": 188,
      "rows_produced_per_join": 188,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "19.48",
        "eval_cost": "18.80",
        "prefix_cost": "38.28",
        "data_read_per_join": "492K"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`goimagine`.`categories`.`parent_id` in (2952,2977,3007,3008,2995,2929,2984,3015,3016,2922,2985,2986,2919,2971,2988,3009,3010,2949,3011,3012,3014,2947,2982,2990,11373,2920,2973,11372,2951,2987,11374,2950,2930,2946,2981,2898,2921,2972,11369,2927,2989,3017,3018,2529,7760,2901,2894,2909,2963,2900,2528,2911,2964,2895,2896,2913,2965,2530,2890,2531,2914,2966,2893,2532,2899,2892,2968,2970,2902,2932,2891,2956,2944,2991,2992,2974,2918,2967,2916,2903,2978,2915,2904,2948,2962,2928,2957,2943,2975,2917,2969,2953,2960,2945,2980,2983,2954,2961,2955,2979,2959,2958,2994,2993))"
    }
  }
}

Result

category_id parent_id
2532 2530
2909 2530
2911 2530
2913 2530
2914 2530
2915 2530
2916 2530
2917 2530
2918 2530
2928 2530
2932 2530
2943 2530
2944 2530
2945 2530
2948 2530
2953 2530
2954 2530
2958 2530
2959 2530
2961 2530
2993 2530
2955 2531
2956 2531
2957 2531
2960 2531
2962 2531
2963 2531
2964 2531
2965 2531
2966 2531
2967 2531
2968 2531
2969 2531
2970 2531
2974 2531
2975 2531
2978 2531
2979 2531
2980 2531
2983 2531
2994 2531
2891 2890
2898 2890
2987 2892
2988 2892
2989 2892
2990 2892
2894 2893
2895 2893
2528 2896
2529 2896
2890 2896
2893 2896
2899 2896
2902 2896
2903 2896
2904 2896
2991 2896
2992 2896
2900 2899
2901 2899
2995 2899
2919 2918
2920 2918
2921 2918
2922 2918
2927 2918
3007 2918
3012 2918
2929 2928
2930 2928
2986 2928
2946 2945
2947 2945
2949 2948
2950 2948
2952 2948
3009 2948
3015 2948
3018 2948
2971 2970
2972 2970
2973 2970
3008 2970
3014 2970
2951 2978
2977 2978
3010 2978
3011 2978
3016 2978
3017 2978
2981 2980
2982 2980
2984 2983
2985 2983
11372 11369
11373 11369
11374 11369
11375 11369
11376 11369