Disk full (/var/tmp/#sql_2a7a_0); waiting for someone to free some space...
SELECT COUNT(DISTINCT p.productID) as cnt FROM (SELECT p.*, GROUP_CONCAT(CONCAT( p.productID,sp.variantID)) as model FROM SC_products p LEFT JOIN SC_product_options_set sp ON (sp.productID = p.productID AND sp.optionID = 52) group BY p.productID) p WHERE ( (p.productID IN (958,1071,1225)) OR (categoryID IN (622)) ) AND ( enabled=1)