Skip to content

merge_chunks_concurrently()

Merge two or more chunks into one chunk without blocking reads

Since 2.18.0

Merge two or more chunks into one in concurrent mode without locking out other reads. The functionality is equivalent to merge_chunks() with the concurrently option set, although this procedure works with more than two chunks. See merge_chunks() for more information.

  • Merge three chunks, allowing concurrent reads:

    CALL merge_chunks_concurrently('_timescaledb_internal._hyper_1_1_chunk', '_timescaledb_internal._hyper_1_2_chunk', '_timescaledb_internal._hyper_1_3_chunk');

You can merge either two chunks, or an arbitrary number of chunks specified as an array of chunk identifiers.

NameTypeDefaultRequiredDescription
chunksREGCLASS[]-The array of chunks to merge in partition order

This procedure does not return a value. Upon successful completion, the specified chunks are merged into a single chunk.