Caching (Transform)
note
Caching is only available to Transform users and is not available in MetricFlow.
Transform has caching features that improve the performance of querying metrics. There are three different types caching features available to speed up requests and ensure that, if possible, every request doesn't compute the metrics from the source tables since that causes latency.
Aggregation Cache
Transform's semantic layer has a powerful Aggregation Cache. The Aggregation Cache speeds up requests by saving previous intermediate states of datasets for certain measures so that subsequent and similar requests are sped up significantly. The Aggregation Cache relies on information in the data warehouse, and items in it expire based on the mutability configuration as defined in the corresponding data source, as well as the age of the item.
In-Memory Cache
This cache lives outside the semantic layer and ensures user interface queries are fast after the first run. This is independent of any other layers of caching; it attempts to serve data that already exists in memory for a particular request if the query was run recently before. There is a time-based expiration on these queries. If a user queries the Transform UI at the start of their day, it's likely to be a little slower because queries aren't in the In-Memory Cache. They should notice a speed-up once people start using the application and making similar requests because of this cache.
How Results are Returned
When a query is run against Transform, the following steps occur:
- If the query is issued from the UI, Transform checks the In-Memory cache to return a result from memory if possible.
- If the data isn't in the In-Memory cache, or the query was executed outside the UI, Transform will first check the materialized tables in the data warehouse and Fast Cache for the data. If it can return the data from any of these sources, it will.
- If it cannot find the data from Step 1, it will check the Aggregation Cache and attempt to return a result.
- If it cannot find the result from Step 1 or 2 or 3, we will compute the data from scratch: