Skip to content

remove_compaction_policy()

Remove a compaction policy from a hypertable

Since 2.29.0

Remove a compaction policy from a hypertable.

Unordered chunks are no longer compacted automatically, so queries against them keep the extra sort step needed to restore order. To restart automatic compaction, call add_compaction_policy again. Turning off direct_compress also removes the policy it created.

You see the compaction policies in the informational views.

  • Remove the compaction policy from the metrics hypertable:

    SELECT remove_compaction_policy('metrics');

The syntax is:

SELECT remove_compaction_policy(
hypertable = '<hypertable_name>',
if_exists = true | false
);
NameTypeDefaultRequiredDescription
hypertableREGCLASS-Name of the hypertable to remove the policy from
if_existsBOOLEANfalseSet to true so this job fails with a warning rather than an error if a compaction policy does not exist on hypertable

This function returns void.