Sample Header Ad - 728x90

timescaledb/postgresql size reduction - _timescaledb_internal tables take up tons of space after deleting rows

0 votes
1 answer
74 views
I have a timescaledb set up, from which I just deleted a large amount of data. I vacuumed the tables that I deleted the data from, and the output of pg_size_pretty(pg_database_size(current_database())) dropped from 87GB to 50GB. However, I deleted almost all of the data, so I was expecting the size to drop to basically nothing. If I run a query to sum the size of the tables from each table schema, I get this result:
NOTICE:  Total size of the database: 50 GB
NOTICE:  Size of large objects: 8192 bytes
NOTICE:  Schema pg_catalog total table size: 24 MB
NOTICE:  Schema information_schema total table size: 248 kB
NOTICE:  Schema _timescaledb_cache total table size: 0 bytes
NOTICE:  Schema _timescaledb_catalog total table size: 1168 kB
NOTICE:  Schema _timescaledb_internal total table size: 50 GB
NOTICE:  Schema _timescaledb_config total table size: 80 kB
NOTICE:  Schema public total table size: 6680 kB
You can see the public tables where I actually have data points take up less than 7MB, but the internal _timescaledb_internal tables are taking 50GB! How can I reduce this now that most of the data has been deleted?
Asked by Datguy (11 rep)
Apr 28, 2024, 12:18 AM
Last activity: Dec 31, 2024, 04:30 PM