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

Query time 0.00082

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "113.13"
    },
    "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": 80,
          "rows_produced_per_join": 80,
          "filtered": "100.00",
          "using_index": true,
          "cost_info": {
            "read_cost": "1.13",
            "eval_cost": "16.00",
            "prefix_cost": "17.13",
            "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": 80,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "80.00",
            "eval_cost": "16.00",
            "prefix_cost": "113.13",
            "data_read_per_join": "474K"
          },
          "used_columns": [
            "category_id",
            "id_path"
          ]
        }
      }
    ]
  }
}

Result

id_path
266/1936/2601
2910/2912/2917/2928
3648/3751/3796
2653/2658/9276
9997
9997/9999
9997/10000
9997/9998/10004
9997/9998/10006
9997/9999/10008
9997/9999/10008/10009
9997/9999/10008/10010
9997/9999/10008/10011
9997/9999/10008/10012
9997/9999/10008/10013
9997/9999/10008/10014
9997/9999/10008/10015
9997/9999/10008/10016
9997/9999/10008/10017
9997/9999/10018/10019
9997/9999/10022/10023
9997/10000/10025/10026
9997/10000/10025/10027
9997/10000/10025/10028
9997/10000/10025/10029
9997/10000/10025/10030
9997/10000/10025/10031
9997/10000/10032/10034
9997/10000/10036/10037
9997/10041
9997/10000/10032/10077
9997/10000/10025/10166
9997/9999/10008/10167
9997/9999/10008/10168
9997/10000/10025/10374
9997/9999/10008/10375
9997/10000/10025/10376
9997/9999/10008/10377
9997/10000/10025/10378
9997/9999/10008/10381
9997/9999/10008/10382
9997/10041/10611/10383
9997/10041/10611/10384
9997/10041/10611/10385
9997/10041/10611/10387
9997/10041/10611/10388
9997/10041/10611/10389
9997/10041/10611/10390
9997/10041/10611/10392
9997/10041/10611/10394
9997/10041/10611/10395
9997/10450/10451
9997/10450/10452
9997/10041/10611/10392/10514
9997/10513/10515
9997/10513/10516
9997/10576/10577/10578
9997/10576/10577/10579
9997/10576/10577/10583
9997/10587/10588
9997/10587/10589
9997/10587/10590
9997/10587/10591
9997/10041/10592
9997/10587/10593
9997/10041/10612/10594
9997/10587/10595
9997/10587/10596
9997/10041/10612/10597
9997/10041/10602/10598
9997/10041/10612/10599
9997/10041/10611/10600
9997/10587/10601
9997/10041/10602
9997/10041/10611/10603
9997/10041/10612/10604
9997/10041/10612/10605
9997/10587/10606
9997/10041/10611/10607
9997/10587/10610