Building pre-aggregations can allow you to take queries from a 5-minute loading time to under a second - great news! However, you might set up your pre-aggregation and find sometimes your query is still hitting your database.
For example, let’s say you have a pre-aggregation set up with the granularity “month”. This means that any combination of whole months should hit the pre-aggregation.
If you want to test this, you can do so in Cube’s playground by trying different combinations of date ranges and seeing which get accelerated or not.
An example: if you apply a filter asking for 1st June to 31st August on your pre-aggregation that has the “month” granularity, then it can use a monthly pre-aggregation (by adding June, July and August together).
But if you ask for 1st June 11:00 to 1st September 11:00, even though it’s the same range of time, Cube can’t match this to a monthly pre-aggregation, as that pre-aggregation only has data from midnight to midnight, so no combination of the pre-aggregated data will give an accurate result. So it will miss the cache (as it should).