Steps of a MQL Query
When you interact with the Transform User Interace, CLI, or any of our other APIs, you will often be writing queries or materializations. These are Transformed into concrete computations in the steps below.
#
1. Collect MQL Request- MQL request captured from client. Metrics + Dimensions + Constraints
#
2. Find Candidate Data Sources (in the dynamic cache)- MQL server with check the following options:
- If the exact query is available in the result cache, use that to return the results.
- If the metrics and dimensions can be satisfied through the fast cache, use that to return the results.
- If there's a materialization in the DW that can satisfy the request, use that to return the results.
- Metrics, dimensions, and potential join paths are identified.
- Candidate data sources are "primed"
#
3. Construct a query- Data Sources joined along the join paths specified by identifiers in the data sources from which the user has requested metrics and dimensions.
- Metrics are aggregated to to granularity of the dimensions passed and filtered based on time constraints.
- Joins and aggregations happen at an appropriate time based on the request to build an efficient query.
#
5. (optional) Write to cache- If specified, results are written to the Transform cache.
#
6. Query final table in Cache or DW + apply non-time constraints- Final table is queried and results are filtered based on non-time constraints.