Skip to content

[Bug]: problem with reclaim disk spaceΒ #10286

Closed

Description

@h0rn3t

What type of bug is this?

Incorrect result

What subsystems and features are affected?

Other

What happened?

Summary

We have a TimescaleDB hypertable that is continuously receiving new data.
A separate business process continuously deletes a portion of historical rows.

The hypertable is approximately 9 TB. The total database size is
approximately 19 TB.

public.large_hypertable

Problem

Running:

VACUUM (FULL, ANALYZE, VERBOSE) public.large_hypertable;

reclaims approximately 2 TB of disk space. However, the operation takes
approximately 17 hours.

During this operation, queries against the affected hypertable/chunks are
blocked by locks. This is unacceptable for a production workload that must
continue serving reads and writes.

The largest individual chunks are approximately 9–12 GB each.

We attempted to process compressed chunks independently and in parallel:

VACUUM (FULL, ANALYZE, VERBOSE)
_timescaledb_internal._hyper_<hypertable_id>_<chunk_id>_chunk;

The command finishes successfully for each logical chunk, but does not reclaim
the expected disk space. In contrast, VACUUM FULL on the entire hypertable
does reclaim space.

Example of the parallel run:

  • 3101 compressed chunks discovered
  • 3101 individual VACUUM FULL ANALYZE commands completed successfully
  • 0 SQL errors
  • Execution time: approximately 2 minutes 39 seconds
  • Expected disk-space reduction was not observed

Environment

TimescaleDB: 2.28.2
PostgreSQL: 17.10
Hypertable: public.large_hypertable
Hypertable size: ~9 TB
Total database size: ~19 TB
Disk space reclaimed by VACUUM FULL on the hypertable: ~2 TB
Largest chunks: ~9–12 GB

Questions

  1. Is VACUUM FULL on an individual logical compressed chunk
    (_timescaledb_internal._hyper_*_chunk) expected to reclaim storage from
    the underlying compressed relation?

  2. Is there a supported API to identify the physical compressed relation for
    each logical chunk and safely run VACUUM FULL on it?

  3. Is there a supported way to run VACUUM FULL for compressed hypertables
    chunk-by-chunk and in parallel, while avoiding a long blocking operation on
    the entire hypertable?

  4. If this is not supported, what is the recommended maintenance strategy for
    a multi-terabyte compressed hypertable with continuous inserts and deletes?

We need to reclaim disk space without blocking the production workload for
many hours.

TimescaleDB version affected

2.28.2

PostgreSQL version used

17.10

What operating system did you use?

Ubuntu 24.04 x64

What installation method did you use?

Source

What platform did you run on?

On prem/Self-hosted

Relevant log output and stack trace

How can we reproduce the bug?

We attempted to process compressed chunks independently and in parallel:

VACUUM (FULL, ANALYZE, VERBOSE)
_timescaledb_internal._hyper_<hypertable_id>_<chunk_id>_chunk;

The command finishes successfully for each logical chunk, but does not reclaim
the expected disk space

Activity

  1. added
    v2.28.2
    on Jul 17, 2026
  2. svenklemm commented on Jul 17, 2026

    @svenklemm
    Member

    Did you analyze which objects consume the space? Did you vacuum the internal compressed chunks or the uncompressed chunks?

    1. Yes it should propagate but there was a bug where that was not the case.
    2. I wouldn't call it API but you can look it up in _timescaledb_catalog.compression_settings. relid is uncompressed relation, compress_relid is compressed relation
    3. Not atm but in the future REPACK might provide that
    4. Doing per chunk transactions should work, if it doesnt its a bug
  3. sh4rkyusa-hub commented on Jul 22, 2026

    @sh4rkyusa-hub

    I wonder why here #9648 possibility to enable triggers on chunk tables was not implemented. That would possibly allow usage of pg_repack on chunks
    Yet trying to run repack on chunk give an error
    ERROR: operation not supported on chunk tables

  4. added a commit that references this issue on Jul 28, 2026
  5. added a commit that references this issue on Jul 28, 2026
  6. added a commit that references this issue on Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugv2.28.2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions