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

Query time 0.00074

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "22.08"
    },
    "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": 47,
          "rows_produced_per_join": 47,
          "filtered": "100.00",
          "using_index": true,
          "cost_info": {
            "read_cost": "0.93",
            "eval_cost": "4.70",
            "prefix_cost": "5.63",
            "data_read_per_join": "752"
          },
          "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": 47,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "11.75",
            "eval_cost": "4.70",
            "prefix_cost": "22.08",
            "data_read_per_join": "123K"
          },
          "used_columns": [
            "category_id",
            "id_path"
          ]
        }
      }
    ]
  }
}

Result

id_path
4
5
5/25
5/26
8/39
4/45
4/46
4/47
4/48
4/51
71
78
3/87
71/91
5/96
5/97
78/105
78/107
78/108
109
109/118
109/123
109/124
2/13/135
2/15/169
4/45/187
4/45/189
4/46/195
4/46/195/196
4/46/198
4/46/199
4/46/200
4/46/206
4/46/207
4/46/208
4/47/220
4/52/228
4/51/250
4/51/253
12/59/317
4/51/6638
3/14/6648
5/62/6657
5/26/6691
5/26/6692
4/46/195/22740/7651