Skip to content

Conversation

@noctarius
Copy link

@noctarius noctarius commented Feb 24, 2023

This PR is a work in progress to test and work on a redesign of the timescale part of the implementation. The main focus is to minimize disk space consumption, increase the compressibility of the table and apply some general best practices.

This PR may eventually resolve #25

@noctarius noctarius marked this pull request as draft February 24, 2023 14:27
@noctarius noctarius force-pushed the master branch 29 times, most recently from bf980ef to e74c823 Compare March 2, 2023 17:10
@noctarius noctarius force-pushed the master branch 19 times, most recently from 6133a28 to a146ffc Compare March 3, 2023 13:11
@freol35241
Copy link
Owner

@noctarius

I can see that you are putting a lof of effort in this and I am grateful for that. But just to be clear, removing the id column is a definitive yes from my side whereas the separate table/ltree approach to the attributes is interesting but merging of it is highly dependant on the complexity introduced to the codebase.

@noctarius
Copy link
Author

Which is fair. No worries on that. The complexity is fairly low, as you can see from the code changes. Happy to fork it out if you don't want to deal with it. I'm basically doing it for myself. Even though I hate Python 😅

@noctarius noctarius force-pushed the master branch 2 times, most recently from 08c9747 to f73e065 Compare March 3, 2023 15:05
@antoonhuiskens
Copy link
Contributor

nice work sofar! I'm spending quite some time refining my timescaledb setup. One of the nice things you can do is rollup of chunks into larger compressed chunks, improving compression even more. In order to gracefully work, there's two things to consider:

  • compression policy to use
    • compress_orderby = 'time ASC'
    • compress_segmentby = 'entity_id'
  • the compress_chunk_time_interval needs to be an integer multiple of the chunk_interval. (i.e. 7 day chunks to 28 days compressed would work, but 7 day chunks to 30 day compressed wouldn't.
  • maybe also consider the version of timescaledb... since only since 2.11 there's no constraints on updating data in compressed chunks.

segment_by is documented here: https://docs.timescale.com/use-timescale/latest/compression/compression-design/

order_by time ASC is documented here:
https://docs.timescale.com/use-timescale/latest/compression/manual-compression/#roll-up-uncompressed-chunks-when-compressing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include support for more TimescaleDB features

3 participants