Create a policy to reorder chunks on a given hypertable index in the background. You can only one reorder policy on each hypertable. Only chunks that are the third from the most recent are reordered to avoid reordering chunks that are still being inserted into. For more information about reordering chunks, see the reorder_chunk section.
When a chunk has been reordered by the background worker it is not reordered again. If you insert significant amounts of data in to older chunks that have already been reordered, you might need to manually re-run the reorderchunk function on older chunks. Alternatively, you can drop and re-create the policy, which can work better if you have changed a lot of older chunks.
|REGCLASS||Hypertable to create the policy for|
|TEXT||Existing index by which to order rows on disk|
|TIMESTAMPTZ||Time the policy is first run. Defaults to NULL. If omitted, then the schedule interval is the interval between the finish time of the last execution and the next start. If provided, it serves as the origin with respect to which the |
|TEXT||A valid time zone. If |
|BOOLEAN||Set to true to avoid an error if the |
|INTEGER||TimescaleDB background job ID created to implement this policy|
SELECT add_reorder_policy('conditions', 'conditions_device_id_time_idx');
Creates a policy to reorder chunks by the existing
(device_id, time) index.
This applies to chunks that are complete, and are no longer being written to.
For more information about reordering chunks, see the
Found an issue on this page?Report an issue!