Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: INSERT into compressed chunks does not clean dead tuples #4578

Closed
svenklemm opened this issue Aug 5, 2022 · 2 comments
Closed

[Bug]: INSERT into compressed chunks does not clean dead tuples #4578

svenklemm opened this issue Aug 5, 2022 · 2 comments
Labels

Comments

@svenklemm
Copy link
Member

svenklemm commented Aug 5, 2022

What type of bug is this?

Performance issue

What subsystems and features are affected?

Compression

What happened?

We have a "storage leak" in compression, more specifically the insert into compressed chunks feature. The leak is due to the way we disable vacuum on these chunks leading to dead tuples never getting cleaned up. To detect these simply checking n_dead_tup is not enough because it will never be updated, you need to explicitly ANALYZE the chunk and check n_dead_tup after. This is also a performance issue as all those dead tuples have to be scanned when scanning the table.

TimescaleDB version affected

2.3+

PostgreSQL version used

14.4

What operating system did you use?

Archlinux 2022.07.01 x64

What installation method did you use?

Source

What platform did you run on?

On prem/Self-hosted

Relevant log output and stack trace

SELECT n_dead_tup from pg_stat_user_tables where relid=<chunk with compression>;
-[ RECORD 1 ]----------
n_dead_tup | 1363992372
@svenklemm svenklemm added the bug label Aug 5, 2022
@svenklemm
Copy link
Member Author

Seems like this is only a problem when the job errors. Couldn't reproduce it in normal operation.

@antekresic
Copy link
Contributor

Fixed by #5118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants