You can control when a query executes by configuring its cache settings. When the cache is disabled, your query will execute with every run of your project.
The following configuration options are available when caching is enabled:
On initial app load: The query will only execute and update the cache when a user first loads (or refreshes) an app. Any other run of the project will use the cached values of the query.
On scheduled run: The query will only execute and update the cache on the schedule run of the project. Any other run of the project will use the cached values of the query. "On scheduled run" is not an available caching option unless you have configured your project to run on a schedule, as described here.
On parameter change (always true): If a user changes an input parameter that is used in a SQL query, that query will always run.
As an example, the screenshot below demonstrates a query that will only execute if a user changes the input parameter,
$country , or during a scheduled project run on the 43rd minute of each hour. At all other times, the project will use the cached values of this query.