SELECT COUNT(*) as dup_pairs FROM (
  SELECT product_id, feed_id, COUNT(*) as c
  FROM product_offers
  GROUP BY product_id, feed_id
  HAVING COUNT(*) > 1
) sub;
SELECT COUNT(*) as total_offers FROM product_offers;
