mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-17 11:03:36 +08:00
The current hypertable creation interface is heavily focused on a time column, but since hypertables are focused on partitioning of not only time columns, we introduce a more generic API that support different types of keys for partitioning. The new interface introduced new versions of create_hypertable, add_dimension, and a replacement function `set_partitioning_interval` that replaces `set_chunk_time_interval`. The new functions accept an instance of dimension_info that can be constructed using constructor functions `by_range` and `by_hash`, allowing a more versatile and future-proof API. For examples: SELECT create_hypertable('conditions', by_range('time')); SELECT add_dimension('conditions', by_hash('device')); The old API remains, but will eventually be deprecated.