How to define calendar year for hypertable chunks

Hello!

Is there possibility to define calendar year for chunks of hypertable? At now when I create a hypertable

SELECT create_hypertable('schema.myhypertable', 'ts', chunk_time_interval => INTERVAL '1 year');

then the first chunk range_start value equals 2016-04-29 instead of 2017-01-01.

Thanks in advance

Best regards,
Denis

Hi LuxCore,

Unfortunately I don’t think this can’t be done at the moment, TimescaleDB will use the natural start of the interval used for the chunk_time_interval.

Can you talk me through the use-case for this?

-James

There are queries that may use calendar year like

select col1 from hypertable where ts >= '2021-01-01' and ts < '2022-01-01';

If the chunks were within one calendar year, then the plan could use only one chunk. In addition, it would be a replacement of standard partitioning for the required range.

Thank you.
Best regards,
Denis