SELECT 
  DISTINCT pc.category_id, 
  count(DISTINCT pc.product_id) as total_products 
FROM 
  ushop_products AS products 
  LEFT JOIN ushop_products_categories AS pc ON products.product_id = pc.product_id 
WHERE 
  0 
GROUP BY 
  pc.category_id

Query time 0.00151

JSON explain

{
  "query_block": {
    "select_id": 1,
    "message": "Impossible WHERE"
  }
}