SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    7418, 
    7426, 
    7427, 
    7428, 
    7436, 
    7444, 
    7401, 
    8292, 
    7402, 
    7807, 
    7403, 
    7755, 
    8151, 
    7404, 
    7405, 
    7406, 
    7407, 
    7408, 
    7409, 
    7410, 
    7411, 
    7412, 
    7413, 
    7808, 
    7414, 
    7415, 
    7416, 
    7756, 
    7417, 
    7419, 
    7420, 
    7757, 
    7809, 
    7421, 
    7422, 
    7423, 
    7424, 
    7425, 
    8152, 
    7429, 
    7430, 
    7431, 
    7432, 
    7433, 
    7434, 
    8229, 
    7435, 
    8230, 
    7437, 
    8231, 
    7810, 
    7438, 
    7439, 
    7440, 
    7758, 
    7441, 
    8293, 
    8294, 
    8295, 
    8296, 
    8297, 
    8298, 
    8299, 
    7442, 
    8300, 
    8249, 
    7443, 
    7445, 
    7446, 
    7759, 
    7447, 
    7448, 
    7449, 
    7450, 
    7812, 
    7451, 
    7452, 
    8232, 
    8233, 
    7453, 
    7760, 
    8234, 
    8235, 
    8236, 
    8153, 
    8237, 
    8238, 
    8239, 
    8240, 
    8241, 
    8242, 
    8243, 
    8244, 
    7761, 
    8245, 
    7762, 
    8246, 
    8247, 
    8248, 
    8066, 
    7592, 
    8017, 
    7887, 
    7913, 
    7966, 
    7945, 
    7283, 
    7318, 
    8112, 
    8021, 
    7893, 
    7982, 
    7944, 
    7953, 
    7288, 
    7332, 
    8113, 
    8035, 
    7302, 
    7986, 
    8114, 
    8036, 
    7308, 
    7987, 
    8115, 
    8039, 
    7342, 
    7989, 
    8116, 
    8043, 
    7352, 
    8117, 
    8045, 
    7370, 
    8118, 
    8048, 
    7382, 
    8119, 
    8052, 
    7394, 
    7604, 
    8120, 
    7827, 
    8121, 
    7614, 
    7834, 
    8122, 
    7652, 
    7838, 
    8123, 
    7659, 
    7841, 
    8124, 
    7663, 
    7844, 
    8125, 
    7664, 
    7848, 
    8126, 
    7670, 
    7853, 
    8127, 
    7884, 
    7803, 
    7889, 
    7819, 
    7894, 
    7824, 
    7901, 
    7906, 
    7908, 
    7949, 
    7957, 
    7964, 
    7967
  )

Query time 0.00138

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "104.80"
    },
    "table": {
      "table_name": "cscart_categories",
      "access_type": "range",
      "possible_keys": [
        "parent"
      ],
      "key": "parent",
      "used_key_parts": [
        "parent_id"
      ],
      "key_length": "3",
      "rows_examined_per_scan": 259,
      "rows_produced_per_join": 259,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "53.00",
        "eval_cost": "51.80",
        "prefix_cost": "104.80",
        "data_read_per_join": "1M"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`webmarco`.`cscart_categories`.`parent_id` in (7418,7426,7427,7428,7436,7444,7401,8292,7402,7807,7403,7755,8151,7404,7405,7406,7407,7408,7409,7410,7411,7412,7413,7808,7414,7415,7416,7756,7417,7419,7420,7757,7809,7421,7422,7423,7424,7425,8152,7429,7430,7431,7432,7433,7434,8229,7435,8230,7437,8231,7810,7438,7439,7440,7758,7441,8293,8294,8295,8296,8297,8298,8299,7442,8300,8249,7443,7445,7446,7759,7447,7448,7449,7450,7812,7451,7452,8232,8233,7453,7760,8234,8235,8236,8153,8237,8238,8239,8240,8241,8242,8243,8244,7761,8245,7762,8246,8247,8248,8066,7592,8017,7887,7913,7966,7945,7283,7318,8112,8021,7893,7982,7944,7953,7288,7332,8113,8035,7302,7986,8114,8036,7308,7987,8115,8039,7342,7989,8116,8043,7352,8117,8045,7370,8118,8048,7382,8119,8052,7394,7604,8120,7827,8121,7614,7834,8122,7652,7838,8123,7659,7841,8124,7663,7844,8125,7664,7848,8126,7670,7853,8127,7884,7803,7889,7819,7894,7824,7901,7906,7908,7949,7957,7964,7967))"
    }
  }
}

Result

category_id parent_id
7318 7308
7332 7308
7592 7394
7604 7394
7614 7394
7652 7394
7659 7394
7663 7394
7664 7394
7670 7394
7803 7394
7819 7394
7824 7394
7755 7411
7756 7411
7757 7411
7758 7411
7759 7411
7760 7411
7761 7411
7762 7411
7807 7414
7808 7414
7809 7414
7810 7414
7812 7414
7887 7416
7893 7416
7945 7420
7953 7420
7966 7427
7982 7427
7986 7427
7987 7427
7989 7427
8066 7435
8112 7435
8113 7435
8114 7435
8115 7435
8116 7435
8117 7435
8118 7435
8119 7435
8120 7435
8121 7435
8122 7435
8123 7435
8124 7435
8125 7435
8126 7435
8127 7435
8229 7435
8230 7435
8231 7435
8232 7435
8233 7435
8234 7435
8235 7435
8236 7435
8237 7435
8238 7435
8239 7435
8240 7435
8241 7435
8242 7435
8243 7435
8244 7435
8245 7435
8246 7435
8247 7435
8248 7435
8249 7435
8017 7436
8021 7436
8035 7436
8036 7436
8039 7436
8043 7436
8045 7436
8048 7436
8052 7436
8292 7442
8293 7442
8294 7442
8295 7442
8296 7442
8297 7442
8298 7442
8299 7442
8300 7442
7913 7908
7944 7908
8151 8127
8152 8127
8153 8127