Disk full (/var/tmp/#sql_70a_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 (1071,1225,1071,1225,958,958,1071,1225,958,1071,1225,1160,1224,958,1071,1225)) OR (categoryID IN (631,602,621,622,623,599)) ) AND ( enabled=1)