SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    5319, 
    5383, 
    6936, 
    5660, 
    6025, 
    5921, 
    7309, 
    6867, 
    5331, 
    6512, 
    5985, 
    6894, 
    5995, 
    5927, 
    6052, 
    5413, 
    6562, 
    5744, 
    5895, 
    5514, 
    5779, 
    6796, 
    5548, 
    5528, 
    6160, 
    5907, 
    6114, 
    6825, 
    5391, 
    6499, 
    5533, 
    5611, 
    5621, 
    6625, 
    6992, 
    6083, 
    5856, 
    5956, 
    7251, 
    6346, 
    6258, 
    5489, 
    5504, 
    6382, 
    6953, 
    6814, 
    5371, 
    6039, 
    6033, 
    5421, 
    6005, 
    5554, 
    5536, 
    6966, 
    5901, 
    6171, 
    6883, 
    5748, 
    5920, 
    6848, 
    5671, 
    6554, 
    7325, 
    6655, 
    5538, 
    5523, 
    5405, 
    5642, 
    7284, 
    7025, 
    6506, 
    6060, 
    5866, 
    6403, 
    6363, 
    5338, 
    5510, 
    5493, 
    6919, 
    5447, 
    7304, 
    6053, 
    6076, 
    5565, 
    6189, 
    6973, 
    6978, 
    6934, 
    5426, 
    6612, 
    5756, 
    5812, 
    7340, 
    5903, 
    5467, 
    5654, 
    5988, 
    5944, 
    5676, 
    5542, 
    5931, 
    6519, 
    5876, 
    6674, 
    6024, 
    6424, 
    5348, 
    7317, 
    5486, 
    6067, 
    6214, 
    7054, 
    7001, 
    6641, 
    7306, 
    5455, 
    5764, 
    5736, 
    6950, 
    5685, 
    6009, 
    5436, 
    6092, 
    5915, 
    6026, 
    7347, 
    5575, 
    5551, 
    5883, 
    6442, 
    6690, 
    5500, 
    6082, 
    7070, 
    7029, 
    7391, 
    5773, 
    5843, 
    7336, 
    6100, 
    5695, 
    6128, 
    5442, 
    7357, 
    8987, 
    6981, 
    6037, 
    5561, 
    7086, 
    5520, 
    6101, 
    8988, 
    7062, 
    5900, 
    5571, 
    6121, 
    5704, 
    6137, 
    6719, 
    5827, 
    7368, 
    6133, 
    7151, 
    5600, 
    6062, 
    6748, 
    6151, 
    5710, 
    7373, 
    6230, 
    7180, 
    7099, 
    6804, 
    5753, 
    6169, 
    6119, 
    5717, 
    7381, 
    5946, 
    6315, 
    7210, 
    7113, 
    7061, 
    6140, 
    5724, 
    5965, 
    6333, 
    7123, 
    6159, 
    7091, 
    6008, 
    6353, 
    7225, 
    7132, 
    7125, 
    6364, 
    7356, 
    6203, 
    7148, 
    7145, 
    7379, 
    6243, 
    6377, 
    7181, 
    7188, 
    6393, 
    7396, 
    6464, 
    7456, 
    6415, 
    6481, 
    6431, 
    6445, 
    6493, 
    6541, 
    6571, 
    6605, 
    6725, 
    6755, 
    6783, 
    6842, 
    6877
  )

Query time 0.00133

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "445.82"
    },
    "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": 1110,
      "rows_produced_per_join": 1110,
      "filtered": "100.00",
      "using_index": true,
      "cost_info": {
        "read_cost": "223.82",
        "eval_cost": "222.00",
        "prefix_cost": "445.82",
        "data_read_per_join": "6M"
      },
      "used_columns": [
        "category_id",
        "parent_id"
      ],
      "attached_condition": "(`webmarco`.`cscart_categories`.`parent_id` in (5319,5383,6936,5660,6025,5921,7309,6867,5331,6512,5985,6894,5995,5927,6052,5413,6562,5744,5895,5514,5779,6796,5548,5528,6160,5907,6114,6825,5391,6499,5533,5611,5621,6625,6992,6083,5856,5956,7251,6346,6258,5489,5504,6382,6953,6814,5371,6039,6033,5421,6005,5554,5536,6966,5901,6171,6883,5748,5920,6848,5671,6554,7325,6655,5538,5523,5405,5642,7284,7025,6506,6060,5866,6403,6363,5338,5510,5493,6919,5447,7304,6053,6076,5565,6189,6973,6978,6934,5426,6612,5756,5812,7340,5903,5467,5654,5988,5944,5676,5542,5931,6519,5876,6674,6024,6424,5348,7317,5486,6067,6214,7054,7001,6641,7306,5455,5764,5736,6950,5685,6009,5436,6092,5915,6026,7347,5575,5551,5883,6442,6690,5500,6082,7070,7029,7391,5773,5843,7336,6100,5695,6128,5442,7357,8987,6981,6037,5561,7086,5520,6101,8988,7062,5900,5571,6121,5704,6137,6719,5827,7368,6133,7151,5600,6062,6748,6151,5710,7373,6230,7180,7099,6804,5753,6169,6119,5717,7381,5946,6315,7210,7113,7061,6140,5724,5965,6333,7123,6159,7091,6008,6353,7225,7132,7125,6364,7356,6203,7148,7145,7379,6243,6377,7181,7188,6393,7396,6464,7456,6415,6481,6431,6445,6493,6541,6571,6605,6725,6755,6783,6842,6877))"
    }
  }
}

Result

category_id parent_id
5331 5319
5338 5319
5348 5319
5383 5371
5391 5383
5405 5383
5447 5383
5455 5383
5413 5405
5421 5405
5426 5405
5436 5405
5442 5405
5514 5467
5523 5467
5571 5467
5489 5486
5493 5486
5504 5500
5510 5500
5528 5520
5536 5520
5931 5520
5533 5523
5538 5523
5542 5523
5551 5523
5561 5523
5548 5536
5554 5536
5565 5536
5575 5536
8987 5536
5611 5600
5621 5600
5642 5600
5654 5600
5736 5600
5843 5600
5900 5600
6062 5600
6119 5600
6140 5600
6159 5600
5660 5654
5671 5654
5676 5654
5685 5654
5695 5654
5704 5654
5710 5654
5717 5654
5724 5654
5744 5736
5748 5736
5756 5736
5764 5736
5773 5736
5827 5736
5895 5753
5901 5753
5903 5753
5915 5753
6128 5753
6137 5753
6151 5753
6169 5753
5779 5773
5812 5773
5856 5843
5866 5843
5876 5843
5883 5843
5907 5900
5920 5900
5944 5900
6026 5900
6037 5900
5921 5915
5927 5915
6033 5915
6076 5915
6092 5915
6100 5915
6121 5915
5995 5927
6005 5927
6024 5927
5956 5944
5988 5944
6009 5944
5985 5965
6025 6008
6039 6008
6053 6008
6067 6008
6082 6008
6101 6008
6133 6008
6230 6008
6315 6008
6333 6008
6353 6008
6364 6008
6377 6008
6393 6008
6415 6008
6431 6008
6445 6008
6052 6033
6060 6033
6083 6062
6114 6101
6160 6133
6171 6133
6189 6133
6214 6133
6258 6243
6363 6243
6346 6258
6382 6363
6403 6363
6424 6363
6442 6363
6499 6481
6506 6481
6519 6481
6512 6493
6554 6493
6612 6493
6641 6493
6719 6493
6748 6493
6804 6493
6981 6493
7061 6493
7091 6493
7125 6493
7145 6493
6562 6541
6625 6605
6655 6605
6674 6605
6690 6605
6796 6783
6814 6783
6825 6804
6848 6804
6934 6804
6950 6804
6867 6842
6883 6842
6919 6842
7306 6842
7391 6842
8988 6842
6894 6877
6966 6877
6978 6877
7054 6877
7070 6877
7086 6877
7099 6877
7113 6877
7123 6877
7132 6877
7148 6877
7181 6877
7188 6877
6936 6919
6953 6919
6973 6919
7001 6919
7029 6919
7062 6919
7151 6919
7180 6919
7210 6919
7225 6919
7356 6919
7379 6919
7396 6919
7456 6919
6992 6978
7025 6978
7251 7225
7284 7225
7304 7225
7317 7225
7336 7225
7309 7306
7325 7306
7340 7306
7347 7306
7357 7306
7368 7306
7373 7306
7381 7306