suggest_persist_for

Usage

view: view_name {
  dimension: field_name {
    suggest_persist_for: "5 hours"
  }
}
Hierarchy
suggest_persist_for
Possible Field Types
Dimension, Filter, Parameter

Accepts
A string specifying the length of time in seconds, minutes, or hours as follows: "N (seconds | minutes | hours)"

Definition

When Looker determines the values that it will suggest to users when they filter on a dimension or filter field, it runs a query to find the unique values of that field. By default this list of suggestions is cached for 6 hours. However, you can change the amount of time that suggestions are cached using suggest_persist_for.

Looker typically generates suggestions for a dimension by executing a SELECT DISTINCT query on that dimension. For some large tables this query can be too slow, or create too large of a database load. Caching suggestion values for a longer period reduces the number of SELECT DISTINCT queries. Alternatively, if your database is updated frequently, a shorter cache time results in fresher suggestion lists.

Examples

Set the suggestion cache for the name dimension to 30 minutes:

dimension: name {
  sql: ${TABLE}.name ;;
  suggest_persist_for: "30 minutes"
}