Repository navigation
Enable hypercore compression by default on the asset_datapoint table - #2352
Conversation
… exceeded by operation"
richturner
left a comment
There was a problem hiding this comment.
Going to want to change DATA_POINTS_MAX_AGE_DAYS to be something that aligns with DB chunks i.e. weeks as discussed in calls.
Will need a DB migration script to convert old DAYS to weeks
There was a problem hiding this comment.
Pull request overview
This pull request enables TimescaleDB HyperCore (columnstore compression) for the asset_datapoint table to achieve storage savings and improve purge performance. The changes include a database migration to enable columnstore with a 3-month auto-compression policy, an optimized purge strategy using TimescaleDB's drop_chunks() function to avoid decompression overhead, a utility method for datetime conversions, and a comprehensive test validating compression and purging with 2.5 million datapoints.
Key Changes:
- Database migration enables columnstore compression with configurable compression interval
- Purge logic enhanced to use
drop_chunks()for efficient chunk removal, falling back to DELETE when necessary - New
TimeUtil.toInstant()utility method for handling various datetime types
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| V20251216_01__EnableHyperCore.sql | Enables columnstore compression and sets up auto-compression policy for datapoint tables |
| AssetDatapointService.java | Adds optimized purge logic using TimescaleDB's drop_chunks() to avoid decompression overhead |
| TimeUtil.java | Adds utility method to convert various datetime types to Instant |
| PersistenceService.java | Adds configuration property for columnstore compression interval with Flyway placeholder support |
| AssetDatapointHypercoreTest.groovy | Comprehensive test validating compression and purging with 2.5M datapoints across storage measurements |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Saw this error in the logs of an instance running compression: |
|
@richturner which instance was it? Do you know which version of TimescaleDB is running there? |
# Conflicts: # manager/src/main/java/org/openremote/manager/datapoint/AssetDatapointService.java
|
|
Need to decide what the fallback is if the postgres instance doesn't support hypercore, should configuration be part of DB image and then manager warns if |
# Conflicts: # manager/src/main/java/org/openremote/manager/datapoint/AssetDatapointService.java
|
@richturner Looks good. I cannot approve it, because I'm the author |
|
The quick look over is fine, I will do the review of the code you wrote as well |
|



Enables columnstore compression on the
asset_datapointtable for storage savings and faster purges.Changes
Benefits