Skip to main content

Direct Connection Dataset Cache Policy

The main display areas involved are:

  1. Data Details
  2. Page Cards (e.g., selection filters)
  3. Filters

In short: Card data and dataset data are independent.

For example, under the following configuration:

image.png

1. Data Details

The range of filtered and displayed data is determined by the dataset's [Cache Validity Period] setting.

Example: The data details seen at 12:00 are the data updated at 9:00 that day.

2. Page Card Data

Prerequisite: The "Auto Refresh" (formerly "Real-time Data") switch is turned on when the page is opened.
Reason: For real-time display of card data, the "Real-time Data" switch must be on, the card must use a direct connection dataset, and the dataset must have "Support Real-time Card Data" enabled.

image.png

1) When "Support Real-time Card Data" is NOT enabled

Card data is actually the result of the corresponding SQL query directly from the database. As long as the SQL query changes, it will query the database; if there is cached data for the SQL, it will use the cached data.

Example: At 10:00, the default card data is the result of SQL A. At 10:05, after filtering, the query becomes SQL B; both queries fetch data directly from the database. If at 10:08 you switch back to SQL A, it uses the cached result from 10:00. The cache for the same SQL is kept until 9:00 the next day.

2) When "Support Real-time Card Data" is enabled

Now, [Cache Validity Duration] takes precedence over [Cache Validity Period] (or this setting becomes invalid). Regardless of SQL changes, the card's SQL will query the database every minute.

Example: At 10:00, the default card data is the result of SQL A. The card will query SQL A again from the database at 10:01.

3. Filters

Filters associated with the dataset also have corresponding SQL queries and fetch data from the database.

1) When "Support Real-time Card Data" is NOT enabled

Example: At 10:00, filtering with keyword "string1" gives options A. At 10:03, filtering with "string2" gives options B. Both queries fetch data from the database. If the database changes between queries and string1 includes string2, the available options may differ. At 10:05, filtering "string1" again gives options A.

2) When "Support Real-time Card Data" is enabled

Same as the card setting above.

4. Model Structure

When the dataset model uses time macro global parameters:

  1. The data extracted is based on the default value of the time macro global parameter.
  2. If there is a global parameter filter on the page, changing the filter value does not affect the value of the global parameter in the dataset model (it always uses the default value).