SELECT 
  a.category_id 
FROM 
  cscart_categories as a 
  LEFT JOIN cscart_categories as b ON b.category_id IN (266) 
WHERE 
  a.id_path LIKE CONCAT(b.id_path, '/%')

Query time 0.00318

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "1494.60"
    },
    "nested_loop": [
      {
        "table": {
          "table_name": "b",
          "access_type": "const",
          "possible_keys": [
            "PRIMARY",
            "p_category_id"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "category_id"
          ],
          "key_length": "3",
          "ref": [
            "const"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 1,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "0.00",
            "eval_cost": "0.20",
            "prefix_cost": "0.00",
            "data_read_per_join": "5K"
          },
          "used_columns": [
            "category_id",
            "id_path"
          ]
        }
      },
      {
        "table": {
          "table_name": "a",
          "access_type": "index",
          "key": "id_path",
          "used_key_parts": [
            "id_path"
          ],
          "key_length": "767",
          "rows_examined_per_scan": 6988,
          "rows_produced_per_join": 776,
          "filtered": "11.11",
          "using_index": true,
          "cost_info": {
            "read_cost": "97.00",
            "eval_cost": "155.27",
            "prefix_cost": "1494.60",
            "data_read_per_join": "4M"
          },
          "used_columns": [
            "category_id",
            "id_path"
          ],
          "attached_condition": "(`webmarco`.`a`.`id_path` like <cache>(concat('266','/%')))"
        }
      }
    ]
  }
}

Result

category_id
10631
10632
10633
10667
10669
1498
1479
1480
1481
1496
1497
1522
1523
1524
1525
1499
1500
1501
1502
1503
1504
2386
2387
2469
2553
1584
1303
1309
9401
2473
2596
2613
9958
1907
1908
1909
1910
1911
1912
1913
2180
9849
9864
1936
1937
1938
1939
2579
2580
2338
2581
2582
2583
2584
2585
2586
2601
9929
2171
2172
2173
2174
2175
2621
2178
2179
2370
2371
2372
2559
9748
9749
9750
2373
2374
2375
2376
2377
2548
2388
2390
2391
2392
2393
9624
2394
2395
2396
2479
2483
2404
2405
2406
2407
2539
2540
2433
2176
2434
2435
2436
2437
2478
2480
2481
2482
2587
2549
2465
2466
2467
2577
10247
10248
10249
10250
2578
2604
9955
9956
9957
2623
9867
9920
2591
2592
2593
2594
2611
1306
2612
2615
2616
2618
2617
327
1018
1438
1695
1696
1697
1698
2568
2599
2602
2528
2566
2567
2597
328
341
342
343
397
344
2595
345
346
2470
2471
2472
2638
347
348
349
352
9264
356
1506
1714
1715
1914
2397
2398
2399
2400
2401
2402
2403
2468
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2552
393
1516
1517
396
929
1415
1416
1417
1418
1419
1420
2541
9290
394
1861
2389
2554
395
398
399
9294
9623
9921
9922
9923
9924
9940
9941
9944
9945
9946
9942
9943
443
10425
10426
1409
1514
1515
1410
1411
1412
1413
1414
1427
1508
1520
1505
1509
1510
1511
1512
1513
1521
2542
1518
1519
1690
1691
1692
1693
1694
2454
2455
2456
2610
2634
267
444
2631
445
1407
1408
446
447
10409
10410
10411
10413
1441
1442
9842
9843
715
1315
716
930
8944
932
933
953
954
934
955
956
941
935
936
944
952
945
1316
946
947
9961
9692
9693
9694
9695
9830
9840
9841
9844
9845
9846
9847
9848
9855
9856
9857
9858
9859
9860
9861
9862
9863
9865
9866
9918
9919
990
2265
2266
2267
2268
2269
2270
2271
2272
2273
991
2603
992
994
9926
9927
9930
9928
9963
9936