Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for correlated constraints #6727

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on May 16, 2024

  1. Add support for correlated constraints

    Allow users to specify a specific column to be used as a correlated
    constraint using the add_dimension() API. We store such correlated
    constraints in the dimensions related timescaledb catalog tables. The
    "dimension" catalog table has been amended by adding a "type" column.
    This column now explicitly stores the type: open, closed or correlated
    as appropriate.
    
    We create dimension_slice and chunk_constraint entries for chunks which
    have correlated constraints on them. The dimension slice entry will
    have -inf/+inf as start/end range initially for a given correlated
    constraint and the chunk_constraint entry will refer back to this slice
    entry.
    
    This start/end range will be refreshed later. One of the entry points
    is during compression for now.
    
    We can thus store the min/max values for such correlated contraints
    in these catalog tables at the per-chunk level. Note that correlated
    constraints do not participate in partitioning of the data. Such a
    correlated constraint will be used for chunk pruning if the WHERE
    clause of a SQL query specifies ranges on such a column.
    
    A "DROP COLUMN" on a column with a correlated constraint on it ends up
    removing all relevant entries from the catalog tables.
    
    Also a new "remove_dimension" API has been introduced to allow removal
    of correlated dimension entries from the catalogs.
    nikkhils committed May 16, 2024
    Configuration menu
    Copy the full SHA
    03553c9 View commit details
    Browse the repository at this point in the history