Override executeCountQuery method.