Skip to content

[Enhancement]: Custom filters for compression and retention policies #8719

@aliakbarmostafaei

Description

@aliakbarmostafaei

What type of enhancement is this?

API improvement, Performance, Configuration

What subsystems and features will be improved?

Policy, Compression

What does the enhancement do?

I have a table with the following schema that holds OHLC data for candlestick charts:

CREATE TABLE IF NOT EXISTS candles (
    symbol TEXT NOT NULL,
    timeframe TEXT NOT NULL, -- e.g., '1m', '1h', '1d'
    time TIMESTAMPTZ NOT NULL,
    open NUMERIC NOT NULL,
    high NUMERIC NOT NULL,
    low NUMERIC NOT NULL,
    close NUMERIC NOT NULL,
    vol NUMERIC NOT NULL,
    PRIMARY KEY(symbol, timeframe, time)
) WITH (
   tsdb.hypertable,
   tsdb.partition_column='time',
   tsdb.chunk_interval='1 week',
   tsdb.segmentby = 'symbol, timeframe',
   tsdb.orderby = 'time DESC'
);

Problem is that I need different data retention and compression policies for different timeframes (based on the timeframe value), for example I only need to keep 1m data for the last month but keep 1d data indefinitely, I'm relatively new to TimescaleDB and I'm not sure if this is already possible, I went through the documentation but did not find a solution, having the ability to customize compression and retention based columns other than time would really be appreciated.

Implementation challenges

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAn enhancement to an existing feature for functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions