SELECT 
  id_path 
FROM 
  jmj_categories c 
  JOIN jmj_category_vendor_product_count p USING(category_id) 
WHERE 
  p.company_id = 151

Query time 0.00103

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "117.99"
    },
    "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": 82,
          "rows_produced_per_join": 82,
          "filtered": "100.00",
          "using_index": true,
          "cost_info": {
            "read_cost": "3.19",
            "eval_cost": "16.40",
            "prefix_cost": "19.59",
            "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": [
            "jmj_test.p.category_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 82,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "82.00",
            "eval_cost": "16.40",
            "prefix_cost": "117.99",
            "data_read_per_join": "318K"
          },
          "used_columns": [
            "category_id",
            "id_path"
          ]
        }
      }
    ]
  }
}

Result

id_path
3/8/9
3/8/10
3/8/11
3/8/12
3/8/13
3/8/14
3/8/15
3/8/16
3/8/17
3/8/18
3/19/20
3/19/21
3/19/22
3/19/23
3/19/24
3/25/26
3/25/27
3/25/28
3/25/29
3/25/30
2/36/31
2/36/32
2/36/33
2/36/34
2/36/35
2/36/37
2/36/38
2/36/39
2/36/40
2/36/41
2/36/42
2/36/43
2/36/44
2/45/47
2/45/48
2/45/49
2/45/50
2/45/51
2/45/52
2/45/53
2/45/54
2/45/55
2/45/56
2/45/57
2/45/58
2/45/59
2/46/60
2/46/61
2/46/62
2/46/63
2/46/64
2/46/65
2/46/66
4/67/69
4/67/70
4/67/71
4/67/73
4/67/74
4/67/75
4/67/76
4/67/77
4/68/83
4/68/84
4/68/85
4/68/86
78/79/88
5/89/92
5/89/93
5/89/94
5/89/95
5/89/96
5/90/97
5/90/98
5/90/99
5/91/100
5/91/101
5/91/102
5/91/103
4/82/104
4/82/105
4/82/106
4/82/107
4/82/108
78/80/109
78/80/110
78/80/111
78/80/112
78/80/113
78/80/114
78/80/115
78/81/116
78/81/117
78/81/118
78/81/119
78/81/120
78/81/121
78/81/122