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

Query time 0.00278

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "92.11"
    },
    "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": 65,
          "rows_produced_per_join": 65,
          "filtered": "100.00",
          "using_index": true,
          "cost_info": {
            "read_cost": "1.11",
            "eval_cost": "13.00",
            "prefix_cost": "14.11",
            "data_read_per_join": "1K"
          },
          "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": [
            "webmarco.p.category_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 65,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "65.00",
            "eval_cost": "13.00",
            "prefix_cost": "92.11",
            "data_read_per_join": "385K"
          },
          "used_columns": [
            "category_id",
            "id_path"
          ]
        }
      }
    ]
  }
}

Result

id_path
266/356/393/1516
266/1936/2601
2653/2760/2851
2910
2910/2912/2917/2985
2910/2944/3002
2910/2912/3048
2910/2912/3046/3060
2910/2916/3087
2910/3080/3085/3095
2910/3080/3144
2910/3080/3185
2910/3105/3224
2910/3105/3228
2910/3105/3231
2910/3105/3228/3390/3407
2910/2916/3487
3532/3591/3631
3532/3535/3617/3933
4001/4254
4001/4003/4525/4693/5264/4299
4271/4313/4317
4001/4003/4257/4418
4271/4321/4564/4575
4001/4003/4525/4551/4746
4001/4003/4334/4903
4271/4787/4973/5014
4271/4313/5030/5039
3648/3685/5152
4271/4805/5098/5164
4001/4003/4334/4933/5256
4001/4003/4334/4933/5270
5372/5495/5506/5511/5519
2910/5522
4001/4254/4808/5597
5742/5821
4001/4254/4431/5968
5457/6343/6426
6288/6448
2910/2920/3741/6579
6473/6809
6473/6809/6870/6897
6288/6928
6288/6928/6975
5362/6980/7008
5372/5495/5847/7022/7093/7217
6473/7135/7242/7301
5362/7454/7464
6288/6928/7797/7849
6473/7080/7435/8229
5684/6536/8356/8362/8440
5372/5495/5577/8784/8817/8823
6328/6340/6471/9052/9053
2910/2912/2917/9289
2910/2912/2917/2954/9386
4271/4805/4910/9434
4271/4805/4910/9434/9435
4271/4321/4564/4701/9662
9697/9720
9997/10041
10260
10269
10260/10300
10265/10334/10335/10336
6328/10437/10438