Add count via analytics for oracle, postgresql and teradata #556