Skip to content

Conversation

@JamesGuthrie
Copy link
Member

The name 'enable-client-side-sorting' gives one the sense that it could be innocuous to enable.

It maps directly to the enable_direct_compress_copy_client_sorted TimescaleDB GUC, which allows clients to guarantee that all data is in sorted order and that there are no overlapping ranges of data in different compressed batches.

Due to the nature of timescaledb-parallel-copy, this is only safe to use when the following restrictions apply to the data to be inserted:

  • It does not overlap (in the time dimension) with any data which is already stored in compressed form in the database.
  • It is in sorted order (corresponding to the compression settings on the target table, i.e. taking time dimension, segmenting and ordering configuration into account).
  • It is strictly monotonic in the time dimension (taking segment by settings into account).

Failure to adhere to these restrictions can result in incorrect query results.

Base automatically changed from jg/fix-direct-compress-enable to main January 7, 2026 13:22
@JamesGuthrie JamesGuthrie force-pushed the jg/dangerous-client-side-sorting branch from fa0f909 to 89199e7 Compare January 7, 2026 13:45
The name 'enable-client-side-sorting' gives one the sense that it could
be innocuous to enable.

It maps directly to the enable_direct_compress_copy_client_sorted
TimescaleDB GUC, which allows clients to guarantee that all data is in
sorted order and that there are no overlapping ranges of data in
different compressed batches.

Due to the nature of timescaledb-parallel-copy, this is only safe to use
when the following restrictions apply to the data to be inserted:
- It does not overlap (in the time dimension) with any data which is
  already stored in compressed form in the database.
- It is in sorted order (corresponding to the compression settings on
  the target table, i.e. taking time dimension, segmenting and ordering
  configuration into account).
- It is strictly monotonic in the time dimension (taking segment by
  settings into account).

Failure to adhere to these restrictions can result in incorrect query
results.
@JamesGuthrie JamesGuthrie force-pushed the jg/dangerous-client-side-sorting branch from 89199e7 to 74aad17 Compare January 7, 2026 14:57
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.

2 participants