Repository navigation
Add --use-columnstore to the TimescaleDB loader, and fix loading on TimescaleDB >= 2.14 - #298
Merged
Merged
Conversation
create_hypertable lost its replication_factor parameter when multi-node was removed in TimescaleDB 2.14. The loader passed "replication_factor => NULL" on every plain hypertable, so tsbs_load_timescaledb fails on every current TimescaleDB release. Pass no partitioning arguments unless --partitions or --replication-factor is set. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
TSBS had no way to load into the TimescaleDB columnstore (hypercore), so every TimescaleDB result it produced measured uncompressed rowstore chunks, which is not how TimescaleDB is deployed. --use-columnstore converts every chunk to the columnstore once the load finishes, then runs ANALYZE. --columnstore-segmentby (default tags_id) and --columnstore-orderby (default "time DESC") set the layout. The flag is off by default, so existing behaviour is unchanged. The conversion runs from a new optional DBCreatorPostLoad hook that the loader calls after the load has been timed and reported, so it does not count towards the ingest rate. Requires TimescaleDB >= 2.18. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The conversion runs after the timed load, so the reported ingest rate covers rowstore ingest only. Log the conversion time as its own line so the full cost of getting to compressed data can be reported alongside it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
philkra
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two changes to the TimescaleDB target.
1.
create_hypertableno longer getsreplication_factorcreate_hypertablelost itsreplication_factorparameter when multi-node was removed in TimescaleDB 2.14. The loader passedreplication_factor => NULLfor every plain hypertable, sotsbs_load_timescaledbfails on every current release. It now passes no partitioning arguments unless--partitionsor--replication-factoris set.2.
--use-columnstoreTSBS had no way to load into the columnstore (hypercore), so every TimescaleDB result it produced measured uncompressed rowstore chunks.
--use-columnstorefalseANALYZE--columnstore-segmentbytags_idtimescaledb.segmentby--columnstore-orderbytime DESCtimescaledb.orderbyDBCreatorPostLoadhook, called after the load has been timed and reported. It does not count towards the ingest rate. The loader logs the conversion time as a separate line, so both can be reported.tsbs_load_timescaledbandtsbs_load load timescaledb.Testing
Unit tests cover the generated SQL, the version gate, the flag validation, table scoping and the loader hook.
Run end to end against TimescaleDB 2.31.0 on PostgreSQL 17.11 (cpu-only and iot, scale 50, 2 days):
--use-columnstore: all chunks converted, row count unchanged, database 168 MB → 18 MB, queries run against the result.readings,diagnostics) converted; a custom--columnstore-orderbyis applied.--use-columnstore --use-hypertable=falsefails before the load starts.tsbs_load load timescaledbwith a config file.🤖 Generated with Claude Code