docs-v2/content/shared/sql-reference/functions/cache.md

1.3 KiB

The {{< product-name >}} SQL implementation supports the following functions that return data from {{< product-name >}} caches.

distinct_cache

Returns data from an {{< product-name >}} distinct value cache.

distinct_cache(table_name, cache_name)

Arguments

  • table_name: Name of the table associated with the distinct value cache (formatted as a string literal).
  • datatype: Name of the the distinct value cache to query (formatted as a string literal).

{{< expand-wrapper >}} {{% expand "View distinct_cache query example" %}}

SELECT * FROM distinct_cache('example_table', 'exampleCacheName')

{{% /expand %}} {{< /expand-wrapper >}}

last_cache

Returns data from an {{< product-name >}} last value cache.

last_cache(table_name, cache_name)

Arguments

  • table_name: Name of the table associated with the last value cache (formatted as a string literal).
  • datatype: Name of the the last value cache to query (formatted as a string literal).

{{< expand-wrapper >}} {{% expand "View last_cache query example" %}}

SELECT * FROM last_cache('example_table', 'exampleCacheName')

{{% /expand %}} {{< /expand-wrapper >}}