|
51 | 51 | - CUBE.status |
52 | 52 | measures: |
53 | 53 | - CUBE.count |
54 | | - |
| 54 | + |
55 | 55 | # ... |
56 | 56 | ``` |
57 | 57 |
|
@@ -809,15 +809,15 @@ tenants in case different tenants have different pre-aggregation SQL. |
809 | 809 | Choose the count of partitions wisely as those consume memory and CPU resources. |
810 | 810 | As a rule of thumb, you do not want to go over 500-1,000 partitions per pre-aggregation in total |
811 | 811 | to keep the partitioning overhead low. Too many partitions will most likely |
812 | | -cause out of memory. |
| 812 | +cause out of memory. |
813 | 813 | In case of very long build ranges please consider use [Lambda pre-aggregations][ref-caching-lambda-preaggs] to reduce partition count per pre-aggregation. |
814 | 814 |
|
815 | 815 | </WarningBox> |
816 | 816 |
|
817 | 817 | ### `refresh_key` |
818 | 818 |
|
819 | 819 | Cube can also take care of keeping pre-aggregations up to date with the |
820 | | -`refresh_key` property. By default, it is set to `every: '1 hour'`, |
| 820 | +`refresh_key` property. By default, it is set to `every: '1 hour'`, |
821 | 821 | if neither of the cubes' pre-aggregation references don't override `refresh_key`. |
822 | 822 |
|
823 | 823 | <InfoBox> |
@@ -964,6 +964,21 @@ In the above example, the refresh key SQL will be executed every hour. If the |
964 | 964 | results of the SQL refresh key differ from the last execution, then the |
965 | 965 | pre-aggregation will be refreshed. |
966 | 966 |
|
| 967 | +<WarningBox> |
| 968 | +
|
| 969 | +The `every` parameter guarantees that the refresh key will be executed **at |
| 970 | +least** once during the specified interval. However, it does **not** guarantee |
| 971 | +that it will be executed **at most** once. The refresh key may be checked more |
| 972 | +frequently. |
| 973 | + |
| 974 | +When using `every` with `sql`, the purpose is to reduce the load from running |
| 975 | +the refresh key query itself, not to minimize the number of pre-aggregation |
| 976 | +refreshes. The refresh key SQL should be designed to return consistent results |
| 977 | +and only change when the underlying data actually changes, ensuring minimal |
| 978 | +refreshes even if the query is executed multiple times. |
| 979 | + |
| 980 | +</WarningBox> |
| 981 | + |
967 | 982 | #### `incremental` |
968 | 983 |
|
969 | 984 | You can incrementally refresh partitioned rollups by setting |
@@ -1241,7 +1256,7 @@ cubes: |
1241 | 1256 | ### `scheduled_refresh` |
1242 | 1257 |
|
1243 | 1258 | To always keep pre-aggregations up-to-date, you can set |
1244 | | -`scheduled_refresh: true`. This option defaults to `true`. |
| 1259 | +`scheduled_refresh: true`. This option defaults to `true`. |
1245 | 1260 | In production mode, pre-aggregations with `scheduled_refresh: false` will not be |
1246 | 1261 | built automatically and require external orchestration to trigger their refresh. |
1247 | 1262 | Additionally, any `scheduled_refresh: false` pre-aggregations that were built manually or on-demand will be considered |
@@ -1334,8 +1349,8 @@ The SQL queries for the build range (as defined by the `sql` property) are |
1334 | 1349 | executed based on the [`refresh_key`][self-refreshkey] settings of the |
1335 | 1350 | pre-aggregation. |
1336 | 1351 |
|
1337 | | -In case of very small `update_window` or `FILTER_PARAMS` are used in the [`refresh_key`][self-refreshkey] definition |
1338 | | -and the current timestamp is used as `build_range_end`, there's a possibility |
| 1352 | +In case of very small `update_window` or `FILTER_PARAMS` are used in the [`refresh_key`][self-refreshkey] definition |
| 1353 | +and the current timestamp is used as `build_range_end`, there's a possibility |
1339 | 1354 | to write [`refresh_key`][self-refreshkey] which won't refresh due to cycle dependency on each other. |
1340 | 1355 | To address such cases, you can use relative date in the future for the `build_range_end`. |
1341 | 1356 | For example, you can add one day to the current timestamp and use it as `build_range_end`. |
|
0 commit comments