SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    9388, 
    10259, 
    9387, 
    9385, 
    9913, 
    9455, 
    7726, 
    7640, 
    7584, 
    6975, 
    7681, 
    7011, 
    7002, 
    7314, 
    7362, 
    6474, 
    7555, 
    7127, 
    6405, 
    9030, 
    6620, 
    6873, 
    7943, 
    7650, 
    7330, 
    7263, 
    8331, 
    8068, 
    7344, 
    8214, 
    7815, 
    7777, 
    8095, 
    7055, 
    7771, 
    6508, 
    7590, 
    7018, 
    6979, 
    7559, 
    6448, 
    7732, 
    6669, 
    6891, 
    7684, 
    7956, 
    8222, 
    7837, 
    8369, 
    7281, 
    7749, 
    7785, 
    7390, 
    7776, 
    8252, 
    6530, 
    7047, 
    7082, 
    7596, 
    7563, 
    6908, 
    6592, 
    6696, 
    8105, 
    7734, 
    7095, 
    7849, 
    7715, 
    8377, 
    7459, 
    7781, 
    7718, 
    7243, 
    6566, 
    7072, 
    7602, 
    7108, 
    7566, 
    6741, 
    8131, 
    6855, 
    8257, 
    7739, 
    7890, 
    8384, 
    6945, 
    7909, 
    6596, 
    7096, 
    7609, 
    7787, 
    6777, 
    8168, 
    7196, 
    8264, 
    7250, 
    7743, 
    7571, 
    7613, 
    8181, 
    6621, 
    7291, 
    7790, 
    7117, 
    6808, 
    8269, 
    7222, 
    7954, 
    8277, 
    7293, 
    6649, 
    7795, 
    7138, 
    7617, 
    6837, 
    7253, 
    8193, 
    7968, 
    7334, 
    6677, 
    7801, 
    7626, 
    8285, 
    7154, 
    6915, 
    7992, 
    7348, 
    6694, 
    7806, 
    7630, 
    6961, 
    7171, 
    8338, 
    8000, 
    7817, 
    7363, 
    6728, 
    7636, 
    7000, 
    7192, 
    7372, 
    7825, 
    7639, 
    7052, 
    7209, 
    7387, 
    7830, 
    6780, 
    7083, 
    7645, 
    7221, 
    7577, 
    7839, 
    6803, 
    7112, 
    7662, 
    7847, 
    6828, 
    7152, 
    7719, 
    6846, 
    7855, 
    7176, 
    7727, 
    6865, 
    7748, 
    7766, 
    7797, 
    7891, 
    7899, 
    7905, 
    7911, 
    7962, 
    8053, 
    8209, 
    8308, 
    8324, 
    6928
  )

Query time 0.00146

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "130.44"
    },
    "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": 323,
      "rows_produced_per_join": 323,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "65.85",
        "eval_cost": "64.60",
        "prefix_cost": "130.45",
        "data_read_per_join": "1M"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`webmarco`.`cscart_categories`.`parent_id` in (9388,10259,9387,9385,9913,9455,7726,7640,7584,6975,7681,7011,7002,7314,7362,6474,7555,7127,6405,9030,6620,6873,7943,7650,7330,7263,8331,8068,7344,8214,7815,7777,8095,7055,7771,6508,7590,7018,6979,7559,6448,7732,6669,6891,7684,7956,8222,7837,8369,7281,7749,7785,7390,7776,8252,6530,7047,7082,7596,7563,6908,6592,6696,8105,7734,7095,7849,7715,8377,7459,7781,7718,7243,6566,7072,7602,7108,7566,6741,8131,6855,8257,7739,7890,8384,6945,7909,6596,7096,7609,7787,6777,8168,7196,8264,7250,7743,7571,7613,8181,6621,7291,7790,7117,6808,8269,7222,7954,8277,7293,6649,7795,7138,7617,6837,7253,8193,7968,7334,6677,7801,7626,8285,7154,6915,7992,7348,6694,7806,7630,6961,7171,8338,8000,7817,7363,6728,7636,7000,7192,7372,7825,7639,7052,7209,7387,7830,6780,7083,7645,7221,7577,7839,6803,7112,7662,7847,6828,7152,7719,6846,7855,7176,7727,6865,7748,7766,7797,7891,7899,7905,7911,7962,8053,8209,8308,8324,6928))"
    }
  }
}

Result

category_id parent_id
6474 6448
6508 6448
6530 6448
6566 6448
6596 6448
6621 6448
6649 6448
6677 6448
6694 6448
6728 6448
6780 6448
6803 6448
6828 6448
6846 6448
6865 6448
6620 6592
6669 6592
6696 6592
6741 6592
6777 6592
6808 6592
6837 6592
6915 6592
6961 6592
7000 6592
7052 6592
7083 6592
7112 6592
7152 6592
7176 6592
6873 6855
6891 6855
6908 6855
6945 6855
6975 6928
6979 6928
7095 6928
7243 6928
7250 6928
7291 6928
7293 6928
7334 6928
7348 6928
7363 6928
7372 6928
7387 6928
7577 6928
7662 6928
7719 6928
7727 6928
7748 6928
7766 6928
7797 6928
7891 6928
7899 6928
7905 6928
7911 6928
7962 6928
8053 6928
8209 6928
8308 6928
8324 6928
9387 6928
7002 6975
7018 6975
7047 6975
7072 6975
7096 6975
7117 6975
7138 6975
7154 6975
7171 6975
7192 6975
7209 6975
7221 6975
7011 6979
7055 6979
7082 6979
7108 6979
7196 6979
7222 6979
7253 6979
7127 7095
9030 7127
7344 7176
7390 7176
7459 7176
7263 7243
7281 7243
7362 7250
7771 7250
7776 7250
7781 7250
7787 7250
7790 7250
7795 7250
7806 7250
7817 7250
7825 7250
7830 7250
7839 7250
7847 7250
7855 7250
7330 7291
7314 7293
7640 7363
7555 7387
7559 7387
7563 7387
7566 7387
7571 7387
7584 7577
7590 7577
7596 7577
7602 7577
7609 7577
7613 7577
7617 7577
7626 7577
7630 7577
7636 7577
7639 7577
7645 7577
7650 7640
7681 7662
7684 7662
7715 7662
7718 7662
7726 7719
7732 7719
7734 7719
7739 7719
7743 7719
7749 7727
7777 7766
7785 7766
7801 7795
7815 7797
7837 7797
7849 7797
7890 7797
7909 7797
7954 7797
7968 7797
7992 7797
8000 7797
7943 7911
7956 7911
8068 8053
8095 8053
8105 8053
8131 8053
8168 8053
8181 8053
8193 8053
8338 8053
9385 8053
8331 8193
8369 8193
8377 8193
8384 8193
8214 8209
8222 8209
8252 8209
8257 8209
8264 8209
8269 8209
8277 8209
8285 8209
9388 9387
9455 9387
9913 9387
10259 9387