Skip to content

[Feature]: Support creating UNIQUE indices with transaction_per_chunk in hypertables #9395

@jstasiak

Description

@jstasiak

What problem does the new feature solve?

The feature solves the problem of creating unique indices in hypertables without blocking the whole table.

From [1]:

CREATE INDEX ... WITH (timescaledb.transaction_per_chunk, ...);

This option extends [CREATE INDEX][postgres-createindex] with the ability to
use a separate transaction for each chunk it creates an index on, instead of
using a single transaction for the entire hypertable. This allows INSERTs, and
other operations to be performed concurrently during most of the duration of the
CREATE INDEX command. While the index is being created on an individual chunk,
it functions as if a regular CREATE INDEX were called on that chunk, however
other chunks are completely unblocked.

This version of CREATE INDEX can be used as an alternative to
CREATE INDEX CONCURRENTLY, which is not currently supported on hypertables.

  • Not supported for CREATE UNIQUE INDEX.

[1] https://github.com/timescale/docs/blob/bc80fd8daf606f837f2df1194d57774120dbbbb7/api/hypertable/create_index.md

What does the feature do?

Same as existing transaction_per_chunk but enabled for UNIQUE indices.

Implementation challenges

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions