-- Count same-feed duplicates after sync
SELECT COUNT(*) as dup_pairs FROM (
  SELECT p.id, f.id as fid, COUNT(po.id) as offers
  FROM products p
  JOIN product_offers po ON po.product_id = p.id
  JOIN feeds f ON f.id = po.feed_id
  GROUP BY p.id, f.id
  HAVING COUNT(po.id) > 1
) sub;
