SELECT 
  category_id, 
  parent_id 
FROM 
  cscart_categories 
WHERE 
  parent_id IN(
    6852, 
    6565, 
    7128, 
    6739, 
    5596, 
    5678, 
    5603, 
    5651, 
    7535, 
    5857, 
    5865, 
    5880, 
    5877, 
    5784, 
    5797, 
    6651, 
    5963, 
    5983, 
    6077, 
    7093, 
    6939, 
    6148, 
    6358, 
    6441, 
    6190, 
    6211, 
    6274, 
    7510, 
    6347, 
    6401, 
    6413, 
    6507, 
    5590, 
    5848, 
    6134, 
    6959, 
    5666, 
    5673, 
    5713, 
    5970, 
    5889, 
    7156, 
    5767, 
    5887, 
    5806, 
    6670, 
    6757, 
    6031, 
    6000, 
    6096, 
    6163, 
    6368, 
    6455, 
    6584, 
    6242, 
    6226, 
    7513, 
    6360, 
    6466, 
    6516, 
    6444, 
    7536, 
    5721, 
    5858, 
    6267, 
    5899, 
    5992, 
    5897, 
    5835, 
    6680, 
    6772, 
    7175, 
    5950, 
    6036, 
    6011, 
    6468, 
    6256, 
    7516, 
    6372, 
    6478, 
    6529, 
    6457, 
    6392, 
    7537, 
    6604, 
    5905, 
    5728, 
    5909, 
    6043, 
    5868, 
    6697, 
    6109, 
    7186, 
    6132, 
    6279, 
    6484, 
    6287, 
    7519, 
    6491, 
    5923, 
    5738, 
    6064, 
    5918, 
    6705, 
    7204, 
    6292, 
    6496, 
    6178, 
    6300, 
    7520, 
    6539, 
    5932, 
    6079, 
    5930, 
    6794, 
    7217, 
    6311, 
    6505, 
    6322, 
    7521, 
    6337, 
    6553, 
    5941, 
    6829, 
    7238, 
    6325, 
    7524, 
    6391, 
    6572, 
    6895, 
    6409, 
    7526, 
    6588, 
    7374, 
    6921, 
    6429, 
    6610, 
    7385, 
    6527, 
    6976, 
    6626, 
    7561, 
    6550, 
    6994, 
    6647, 
    7572, 
    6638, 
    7587, 
    7022, 
    7593, 
    7503, 
    7534
  )

Query time 0.00126

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 (6852,6565,7128,6739,5596,5678,5603,5651,7535,5857,5865,5880,5877,5784,5797,6651,5963,5983,6077,7093,6939,6148,6358,6441,6190,6211,6274,7510,6347,6401,6413,6507,5590,5848,6134,6959,5666,5673,5713,5970,5889,7156,5767,5887,5806,6670,6757,6031,6000,6096,6163,6368,6455,6584,6242,6226,7513,6360,6466,6516,6444,7536,5721,5858,6267,5899,5992,5897,5835,6680,6772,7175,5950,6036,6011,6468,6256,7516,6372,6478,6529,6457,6392,7537,6604,5905,5728,5909,6043,5868,6697,6109,7186,6132,6279,6484,6287,7519,6491,5923,5738,6064,5918,6705,7204,6292,6496,6178,6300,7520,6539,5932,6079,5930,6794,7217,6311,6505,6322,7521,6337,6553,5941,6829,7238,6325,7524,6391,6572,6895,6409,7526,6588,7374,6921,6429,6610,7385,6527,6976,6626,7561,6550,6994,6647,7572,6638,7587,7022,7593,7503,7534))"
    }
  }
}

Result

category_id parent_id
5596 5590
5767 5590
5950 5590
6132 5590
6178 5590
6337 5590
6391 5590
6588 5590
6610 5590
6626 5590
6647 5590
5603 5596
5666 5596
5673 5596
5721 5596
5728 5596
5738 5596
5651 5603
5678 5673
5713 5673
5784 5767
5848 5767
5858 5767
5868 5767
5918 5767
5930 5767
5941 5767
5797 5784
5806 5784
5835 5784
5865 5857
5970 5857
5992 5857
6043 5857
6064 5857
6079 5857
5880 5865
5889 5865
5899 5865
5909 5865
5923 5865
5932 5865
5877 5868
5887 5868
5897 5868
5905 5868
5963 5950
6031 5950
6036 5950
6109 5950
5983 5963
6000 5963
6011 5963
6077 6036
6096 6036
6148 6132
6163 6132
6190 6178
6242 6178
6256 6178
6287 6178
6300 6178
6322 6178
6211 6190
6226 6190
6274 6256
6358 6325
6368 6325
6392 6325
6347 6337
6360 6337
6372 6337
6401 6391
6466 6391
6478 6391
6491 6391
6539 6391
6553 6391
6572 6391
6413 6401
6444 6401
6457 6401
6441 6429
6455 6429
6468 6429
6484 6429
6496 6429
6505 6429
6507 6491
6516 6491
6529 6491
6565 6550
6584 6550
6604 6550
6651 6638
6670 6638
6680 6638
6697 6638
6705 6638
6794 6638
6829 6638
6895 6638
6921 6638
6976 6638
6994 6638
6739 6705
6757 6705
6772 6705
6852 6794
6939 6921
6959 6921
7093 7022
7503 7022
7534 7022
7128 7093
7156 7093
7175 7093
7186 7093
7204 7093
7217 7093
7238 7093
7374 7093
7385 7093
7561 7093
7572 7093
7587 7093
7593 7093
7510 7503
7513 7503
7516 7503
7519 7503
7520 7503
7521 7503
7524 7503
7526 7503
7535 7534
7536 7534
7537 7534