HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlMinor

Is it ok or how to backfilling an uncompressed hypertable in TimescaleDB?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
hypertablebackfillingtimescaledbhowuncompressed

Problem

For PostgreSQL (v13.4) with TimescaleDB (v2.4.1)

Created a hyper table, with each day as a chunk, and I found a day in last month is missing, so I've inserted those data of the missing day into the old chunk with simple insert statement.

No compression is enabled for the hypertable.

The questions are:

  • Is this backfill operation fine? Probably yes, I guess, just try to confirm.



  • Is there anything else I should / better do, after the backfilling, to make it correct or optimized?



BTW, I've read the official doc of TimescaleDB, only found a topic about backfilling for compressed chunk, which is different from the uncompressed chunk, I guess.

Thanks.

Solution

The backfill itself might be slower than insertion of new data normally is because the indexes needing maintenance might not be in cache to start with. And then once it is done then insertions into the current chunk may also be slower for a while while the evicted cache is repopulated.

And once backfilled, the clustering of the old chunk on its time column will be permanently lower than usual (unless you run a CLUSTER command to restore it). So queries depending on good clustering will be slower than otherwise.

The importance of either one of there is hard to predict, but will probably be fairly small.

Context

StackExchange Database Administrators Q#301938, answer score: 4

Revisions (0)

No revisions yet.