SELECT 
  c.company_id 
FROM 
  cscart_products_categories pc 
  LEFT JOIN cscart_categories c ON c.category_id = pc.category_id 
WHERE 
  pc.product_id = 1298 
GROUP BY 
  c.company_id

Query time 0.00046

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "3.40"
    },
    "grouping_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "1.00"
      },
      "nested_loop": [
        {
          "table": {
            "table_name": "pc",
            "access_type": "ref",
            "possible_keys": [
              "pt"
            ],
            "key": "pt",
            "used_key_parts": [
              "product_id"
            ],
            "key_length": "3",
            "ref": [
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.00",
              "eval_cost": "0.20",
              "prefix_cost": "1.20",
              "data_read_per_join": "16"
            },
            "used_columns": [
              "product_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": [
              "eshopuga_upgr_4122.pc.category_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "1.00",
              "eval_cost": "0.20",
              "prefix_cost": "2.40",
              "data_read_per_join": "2K"
            },
            "used_columns": [
              "category_id",
              "company_id"
            ]
          }
        }
      ]
    }
  }
}

Result

company_id
1