SELECT 
  id_path 
FROM 
  cscart_categories c 
  JOIN cscart_category_vendor_product_count p USING(category_id) 
WHERE 
  p.company_id = 1

Query time 0.00220

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "144.58"
    },
    "nested_loop": [
      {
        "table": {
          "table_name": "p",
          "access_type": "ref",
          "possible_keys": [
            "PRIMARY"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "company_id"
          ],
          "key_length": "4",
          "ref": [
            "const"
          ],
          "rows_examined_per_scan": 316,
          "rows_produced_per_join": 316,
          "filtered": "100.00",
          "using_index": true,
          "cost_info": {
            "read_cost": "2.38",
            "eval_cost": "31.60",
            "prefix_cost": "33.98",
            "data_read_per_join": "4K"
          },
          "used_columns": [
            "company_id",
            "category_id"
          ]
        }
      },
      {
        "table": {
          "table_name": "c",
          "access_type": "eq_ref",
          "possible_keys": [
            "PRIMARY",
            "p_category_id"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "category_id"
          ],
          "key_length": "3",
          "ref": [
            "softwarepirmam_hewadelivard_cscart_4.p.category_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 316,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "79.00",
            "eval_cost": "31.60",
            "prefix_cost": "144.58",
            "data_read_per_join": "989K"
          },
          "used_columns": [
            "category_id",
            "id_path"
          ]
        }
      }
    ]
  }
}

Result

id_path
166
166/167
166/170
166/174
166/174/190
203
203/204/208
219
228
228/229
228/230
228/231
166/234
166/234/235
166/234/236
245
250
250/458/251
250/458/305
250/308
166/320
166/320/321
166/322
166/322/323
166/322/324
166/320/325
166/234/326
166/328
166/329
228/330
228/331
245/332
245/333
245/334
250/336
166/174/337
166/320/339
166/322/340
166/328/341
166/328/342
166/328/543/343
166/329/344
166/329/346
166/329/347
166/350
166/351
166/167/352
166/167/353
166/167/354
166/167/355
166/167/356
166/170/357
166/170/358
166/328/359
166/328/359/360
166/328/359/361
166/328/342/362
166/328/342/363
166/328/364
166/328/366
203/369
250/371
372
166/378
166/378/379
250/380
166/350/381
166/350/382
166/350/383
372/384
250/308/385
250/308/386
250/308/387
250/371/393
250/371/394
250/371/395
250/371/397
250/371/398
166/329/399
250/400
250/401
250/402
250/402/404
250/402/405
250/402/406
250/402/407
250/402/408
250/402/409
250/402/405/410
250/402/405/411
250/402/407/412
250/402/407/413
166/351/414
166/351/414/415
245/332/416
245/332/417
245/332/418
245/333/419
245/333/420
245/334/421
245/334/422
166/423
166/423/424
166/423/425
166/423/424/426
250/458/428
166/351/429
166/351/430
166/378/432
372/434
372/434/435
203/369/436
166/328/438
250/402/439
250/458/251/440
250/336/441
166/378/443
166/167/444
166/351/446
166/423/448
166/423/449
166/423/424/450
166/423/424/451
166/423/424/452
372/453
372/453/454
372/453/455
166/329/457
250/458
372/384/459
372/384/460
372/461
372/461/462
372/461/463
372/461/464
372/566/465
372/466
372/466/467
166/329/468
166/320/469
166/234/470
166/322/471
577/473
577/473/474
577/473/475
577/473/476
166/423/477
245/333/480
166/328/481
250/402/482
166/378/483
250/458/485
166/174/486
372/453/487
250/458/488
250/371/489
166/378/490
250/458/491
166/423/424/492
219/493
219/494
219/496
219/497
219/498
219/499
219/500
219/502
219/503
219/504
166/170/505
166/378/506
219/507
166/513
166/513/514
166/513/515
166/513/516
166/513/517
166/513/518
166/167/519
166/423/520
521
521/522
166/329/399/523
166/329/399/524
166/167/525
166/170/526
166/329/527
166/170/528
166/170/530
166/170/531
166/167/532
521/522/535
521/522/536
521/522/537
521/538
521/538/539
521/538/540
472/542
166/328/543
166/328/543/544
521/545
521/545/546
521/545/547
372/548
372/552/549
372/552/550
372/552/551
372/552
250/553
250/553/554
250/553/555
372/552/556
372/552/557
166/234/559
372/552/557/560
372/552/557/561
250/553/555/562
250/553/555/563
166/328/564
250/402/565
372/566
166/328/543/567
250/402/406/568
250/402/406/569
250/402/406/570
521/545/571
372/572
372/466/573
372/466/574
372/466/575
372/466/576
577
577/578
372/466/579
372/466/580
372/466/581
372/572/582
372/583
372/572/584
166/423/585
166/423/586
372/587
521/534/588
521/534/590
521/534/591
372/572/592/593
372/572/592/594
372/566/595
372/566/596
372/566/597
372/384/598
372/572/599
166/600/601
166/600/602
166/600/603
250/612
166/351/414/613
166/320/614
250/371/615
577/616/617
577/616/618
577/616/619
577/616/620
577/621
577/621/622
577/621/623
577/621/624
577/621/625
577/621/626
577/621/627
558/628
577/629/630
577/629/631
577/629/632
577/629/633
577/629/634
577/629/635
577/629/636
577/629/637
577/629/638
577/639
577/639/640
577/639/641
577/639/642
577/639/643
577/639/644
577/639/645
577/639/646
577/639/647
166/351/648
250/649
577/650/651
577/650/652
577/650/653
372/572/654
372/466/655
250/656
166/423/657
658
658/659
658/660
661
577/662
250/663
664
372/552/666
250/553/667
250/553/668
372/466/669