---
schema_version: "1"
id: fa8196054412b34283f9a55681d868d808f303b5d0d37609db26fa80f3fe8a85
title: Limit the Use of unique()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_saql/guides/reference/bi-saql-performance-unique.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-performance-unique.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 246e38e3c538a8ea1add9c8a72a53dfe390a25c24adea3d9bd18c545bfc0d821
products:
  - Analytics SAQL Developer Guide
  - analytics
---

# Limit the Use of unique()

`unique()` can affect query performance for large datasets that have over 100 million rows and include more than one million unique values. For large datasets, `unique()` is faster for measures than for dimensions. If counting the number of unique string values causes performance issues, convert the string to a number. For example, use a hash of the string value or refer to the index of the string in a sorted list of string values.

**note:** Counting unique values can impact performance, but counting the total number of rows in a dataset doesn’t.
