New release includes several planner improvements and ability to apply multiple continuous aggregates per hypertable.

Today, we released TimescaleDB 1.4 which contains some exciting features that can improve performance for time-series workloads. Specifically in this post, we want to talk a little more about new performance optimizations and an update to continuous aggregates. If you are interested in reading the full release notes, visit the GitHub page.

Before we dive into the details, we’d like to thank all of our users who helped test out this new version prior to its release. Your feedback is always greatly appreciated!

Run-time constraint exclusion performance optimizations

Behind the scenes, our engineers are continually working on optimizing TimescaleDB to achieve the best experience when working with time-series data.

If you are familiar with PostgreSQL’s constraint exclusion, you know that it can result in significant performance improvements. It does this by preventing unneeded chunks from entering the query plan. By reducing the number of chunks accessed, you reduce compute cycles and disk accesses, all of which ultimately speed up your queries.

However, PostgreSQL’s constraint exclusion has some limitations. PostgreSQL only implements constraint exclusion during plan time for normal tables, and runtime constraint exclusion is limited to tables using native partitioning in PG11+.

With this new release, we made several planner improvements to allow users to benefit from constraint exclusion, even for queries that cannot leverage PostgreSQL’s built-in constraint exclusion that occurs during the planning stage. We did this by adding a new custom node called ChunkAppend that can perform execution time constraint exclusion.

This feature is great for advanced PostgreSQL and TimescaleDB users. For more information on how these optimizations work (with example queries!) check out this post.

Multiple continuous aggregates per hypertable

A few months ago, we introduced continuous aggregates in Timescale 1.3. In case you aren’t familiar, automated continuous aggregates can massively speed up workloads that need to process large amounts of data. Particularly for use cases that require snappy dashboards, continuous aggregates reduce the amount of computation required during query time.

And our users were pretty excited:

Now with TimescaleDB 1.4 users can apply multiple continuous aggregates per hypertable, where previously users were only allowed to have one per hypertable. This will enable you to speed up even more historical queries. For example, if you were previously storing continuous aggregates in 5 minute buckets, you can now also store continuous aggregates in 5 minute, 10 minute, hour long, or daily buckets!

Next Steps

Ready to upgrade? Follow these instructions. If you are brand new to TimescaleDB, get started here.

(Note: For Timescale Cloud users, this non-critical upgrade will be available shortly. You can find more information about upgrades here.)

For more information, check out our post on constraint exclusion and OrderedAppend. If you have questions or comments, share them below!