Tiger Cloud: Performance, Scale, Enterprise, Free
Self-hosted products
MST
Chunks can be rewritten by, for example, a merge or a split operation. When such a rewrite runs in concurrent mode it happens across two transactions: the first one rewrites the data to new temporary relations without blocking reads, while the second transaction completes the operation by swapping the relations using heavy locks. If the second transaction does not complete successfully there might be temporary relations left on disk. These relations can take up a significant amount of disk space so they need to be cleaned up using this procedure.
The procedure only cleans up relations that:
- the current user has owner privileges for
- the current user can lock without blocking
- Check for any non-completed rewrite operations:
SELECT * FROM _timescaledb_catalog.chunk_rewrite;chunk_relid | new_relid----------------------------------------+-------------------------------------_timescaledb_internal._hyper_1_2_chunk | _timescaledb_internal.pg_temp_18942_timescaledb_internal._hyper_1_1_chunk | _timescaledb_internal.pg_temp_18942(2 rows)
- Clean up non-completed rewrite operations:
CALL _timescaledb_functions.chunk_rewrite_cleanup();NOTICE: cleaned up 2 orphaned rewrite relations, skipped 0SELECT * FROM _timescaledb_catalog.chunk_rewrite;chunk_relid | new_relid-------------+-----------(0 rows)
Keywords
Found an issue on this page?Report an issue or Edit this page
in GitHub.