6

how can we change the chunk time interval, when it is way too large?

use case:

  • we have an existing hypertable, where we have set the chunk_time_interval to 1 month (when using create_hypertable()).
  • this was fine for the last months, but now the data-rate will be increased by a factor of 1000

e.g. I think we cannot just use set_chunk_time_interval, because it will not affect the current chunk: so when a new month-chunk has just started when the data-rate is increased, this chunk would get huge and only the newer chunks would be right-sized.

So what is the best way to deal with this case?

So to clarify: we want to have one hypertable, where the older data has a different chunk size than the newer data.

TmTron
  • 17,012
  • 10
  • 94
  • 142
  • I've created a feature request [#3472](https://github.com/timescale/timescaledb/issues/3472) – TmTron Aug 11 '21 at 11:52

1 Answers1

5

We do not currently offer a method of changing the range of an existing chunk, but you can use set_chunk_time_interval to change the next chunk to a (say) day or hour-long period.

One approach if your database isn't too large is just to dump your data (e.g., to CSV), then recreate the database with a different setting. Parallel copy will help with faster loading: https://github.com/timescale/timescaledb-parallel-copy

(Timescale person here)

Mike Freedman
  • 1,692
  • 9
  • 9
  • 1
    I don't think dump/restore fits my use-case: the existing (old) data has the correct chunk size, only the new data in the table has a different chunk size: or do you mean that I should drop the newest chunk, change the chunk interval and then restore the data of the newest chunk? – TmTron Aug 19 '19 at 07:29