Hi All,
I’m having a couple of issues with the performance of compressed chunks, maybe my expectations are too high or (hopefully) I’m doing something wrong here.
Situation/setup:
- hypertable with chunksize of a day and (now) around 200M records per chunk(day).
- The size is around 27-30GB per chunk (uncompressed)
- Index on timestamp and device_id (different names in reality, but principle is very much the same)
- There’s around 2M devices each having about a 100 records a day
- compression is setup on timestamp desc and device_id as segment
Now I compress the table and I see the stats going from 27gb to around 1gb when compressed which is very good I’m happy with that!
However I have couple of concerns:
- Compression of a chunk (doing it manually now) takes around 5 minutes for an individual chunk, which is OK
- When compressing multiple chunks using the command found here: it doesnt take days*5 minutes it’s more like forever (yes yes memory at some point is full of course). It this expected? Should it not commit it per chunk?
- Inserts seem to be OK
- Updates on individual device_id are OK, takes a couple of ms regardless if it’s on a specific timestamp or on a > timestamp
- Updates on more than a single device_id (where device_id IN(1,2,3) or where (device_id = 1 or device_id = 2) regardless of specific or > and < timestamp take horribly long and it seems it first decompresses the whole chunk before actually doing the update. I see this is HW statistics, but in the timescale views/functions it still claims the chunk is compressed.
update timeseries_compressed_2 set val=60001000 where (register_id = 836434) and read_ts > '2020-01-01 00:00:00+00';
-- couple of MS for 96 updates
update timeseries_compressed_2 set val=60001000 where (register_id = 836434 or register_id = 9999999) and read_ts > '2020-01-01 00:00:00+00';
-- will takes 5 to 8 minutes