What's New in TimescaleDB 2.9?
- Hierarchical continuous aggregates: you can now create and use a continuous aggregate on top of another continuous aggregate.
- Background jobs: introducing fixed schedules for background jobs and the ability to check and troubleshoot job errors.
- Hyperfunction improvements: improved
time_bucket_gapfillfunction allows to specify the time zone to a bucket.
Let’s explore these improvements in more detail.
Welcome, Hierarchical Continuous Aggregates
With TimescaleDB 2.9 and its later versions, users can downsample their time-series data more efficiently and faster than before by creating continuous aggregate hierarchies.
Each hierarchical continuous aggregate is defined on top of the previous one, providing a lower granularity view of the same dataset while making the refresh process for higher-level continuous aggregates lightning-fast. This also enables TimescaleDB users to define more diverse sets of continuous aggregates without significant additional costs.
For example, a continuous aggregate providing a daily summary only needs to go through 24 records each time it is refreshed when built on top of a continuous aggregate that provides an hourly summary—forget those tens of thousands of records stored in the raw hypertable for that day.
Imagine that you have a finance dashboard, as shown in the example below. With hierarchical continuous aggregates, you can visualize your stock status by week by using pre-aggregated daily data (without going through raw data in the hypertable). This results in super fast response times, which prevent a laggy user experience of the dashboard.
For a more in-depth read about hierarchical continuous aggregates, their examples, and code snippets, read Chris Englebert’s blog post “An Incremental Materialized View on Steroids: How We Made Continuous Aggregates Even Better.”
More Scheduling Options and Better Visibility for Policies and User-defined Actions
TimescaleDB natively includes support for automation policies, such as the following:
- Continuous aggregate policies to automatically refresh continuous aggregates
- Compression policies to compress historical data
- Retention policies to drop historical data
- Reordering policies to reorder data within chunks
Those policies, together with user-defined actions, are meant to run at regular intervals. At a high level, they are jobs scheduled to run asynchronously in the background, facilitated by our job scheduler.
With TimescaleDB 2.9, you can now set jobs to run at specific times by using our newly introduced fixed scheduling semantics. For example, by setting a continuous aggregate policy to start at
03:00 with a 24-hour schedule interval, the job will always be executed at 3:00 a.m. every day.
We also introduced better visibility by providing information about runtime errors encountered by jobs run by the automation framework.
Other Improvements in TimescaleDB
We also continued to improve the
time_bucket_gapfill function to allow specifying the time zone to a bucket.
Try TimescaleDB 2.9
If you are using Timescale, upgrades are automatic, and you’ll be upgraded to TimescaleDB 2.9.1 in your next maintenance window.
New to Timescale? Start a free 30-day trial, no credit card required, and get your new database journey started in five minutes.
If you’re self-hosting TimescaleDB, follow the upgrade instructions in our documentation.