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.00054

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "51.46"
    },
    "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": 36,
          "rows_produced_per_join": 36,
          "filtered": "100.00",
          "using_index": true,
          "cost_info": {
            "read_cost": "1.06",
            "eval_cost": "7.20",
            "prefix_cost": "8.26",
            "data_read_per_join": "576"
          },
          "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": 36,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "36.00",
            "eval_cost": "7.20",
            "prefix_cost": "51.46",
            "data_read_per_join": "213K"
          },
          "used_columns": [
            "category_id",
            "id_path"
          ]
        }
      }
    ]
  }
}

Result

id_path
266
1467
266/1936/2601
2653/2656/2691
2653/2658/2722
2653/2658/2722/2754
2653/2658/2763
2653/2658/2722/2770
2653/2658/2849/2878
2910/2912/2917/2922
2910/2912/2917/2928
2910/3018/3024
2910/2920/3029/3051
3648/3751/3796
4001/4003/4525/4551/4842
5340/5505
6328/6340
3532/3535/3539/3638/7160
5684/6536/6552/7611
6473/7080/7435/8119
2653/2658/9276
266/1584/1309/9401
2910/3105/9832
9997/9999/10008/10011
9697/9947/9948/10159
9997/10450/10451
9997/10450/10452
10193/10197/10484
10193/10197/10492
9997/10000/10522
2653/2658/10563
10623
266/10667
266/10667/10669