Unable to run pageCountMySQL server has gone awaySELECT COUNT(*) AS recCount FROM (SELECT DISTINCT p.* FROM products p LEFT JOIN products_categories pc ON (p.id=pc.ProductID) WHERE 1 AND p.`Deleted`=0 AND ( (p.parentProductID=0 AND p.ParentItemCode='' AND p.HasSubProducts=0) OR (p.ParentProductID>0 AND p.ShowVariationsInListing=1 ) OR (p.ParentProductID=0 AND p.ParentItemCode='' AND p.HasSubProducts>0 AND p.ShowVariationsInListing=0) ) AND 1 AND p.ProductVisibleCache=1 AND p.Visible=1 AND p.SiteID IN (0,8) AND ( p.CategoryID1 IN (740,737,741,711,5,728,706,2,722,713,692,723,736,3,730,687,1,690,16,731,739,6,735,743,734,14,693,710,12,725,709,729,712,742,15,727,691,708,4,733,11,724,13,694,738,707,726) OR p.CategoryID2 IN (740,737,741,711,5,728,706,2,722,713,692,723,736,3,730,687,1,690,16,731,739,6,735,743,734,14,693,710,12,725,709,729,712,742,15,727,691,708,4,733,11,724,13,694,738,707,726) ) AND p.ShowForCustomerGroupIDs='' AND p.visible=1 AND ( p.CategoryID1 IN (741) or p.CategoryID2 IN (741) or CategoryID IN (741) ) ) as t