SELECT 
  id_path 
FROM 
  categories c 
  JOIN category_vendor_product_count p USING(category_id) 
WHERE 
  p.company_id = 7353

Query time 0.00079

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "41.71"
    },
    "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": 91,
          "rows_produced_per_join": 91,
          "filtered": "100.00",
          "using_index": true,
          "cost_info": {
            "read_cost": "0.76",
            "eval_cost": "9.10",
            "prefix_cost": "9.86",
            "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": [
            "goimagine.p.category_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 91,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "22.75",
            "eval_cost": "9.10",
            "prefix_cost": "41.71",
            "data_read_per_join": "238K"
          },
          "used_columns": [
            "category_id",
            "id_path"
          ]
        }
      }
    ]
  }
}

Result

id_path
3/87
2566
18756/17804
17805
17807
17807/17808
18756/18664/18634
18756/18664/18635
18756/18664/18636
18756/18664/18637
18756/18664/18638
18756/18664/18639
18756/18664/18640
17805/18641
17805/18641/18642
17805/18641/18643
17805/18641/18644
17805/18641/18645
17805/18641/18646
17805/18641/18647
17805/18641/18648
17805/18649
17805/18650
17805/18651
17805/18652
17805/18653
17805/18654
17805/18655
17805/18656
17805/18658
17805/18659
17805/18660
17805/18661
17805/18662
18756/17804/18663
18756/18664
18666
18756/17804/18667
17805/18649/18681
17805/18649/18682
17805/18650/18684
17805/18650/18685
17805/18651/18688
17805/18652/18690
17805/18652/18691
17805/18653/18693
17805/18653/18694
17805/18654/18696
17805/18654/18697
17805/18655/18700
17805/18656/18703
17805/18662/18709
17805/18659/18711
17805/18659/18712
17805/18658/18720
17805/18660/18723
17805/18661/18725
17805/18661/18726
17805/18661/18727
17805/18730
17805/18730/18732
17805/18746
18666/18753
18758
18758/18759
18758/18760
17805/18761
17805/18641/18762
17805/18641/18763
17805/19011/18764
18765
18765/18769/18766
18765/18769
18772
18773
18666/18774
18776
18773/18778
18773/18779
18781
18781/18782
18783
18783/18784
18772/18785
18772/18786
18783/18788
18666/18789
18781/18790
17805/18641/18643/19113
17805/18641/18643/19114
17805/18641/18643/19414