C
C
caution2019-12-12 23:05:04
PostgreSQL
caution, 2019-12-12 23:05:04

How to understand why the large size of the table?

Hello.
In psql I do \dt+ and there I see one table with a size: 746 MB
Next, I create a dump of this database:

pg_dump --username=user --format=custom --file=db.backup

I roll it on a clean database: pg_restore -d db_name_new db.backup --no-owner
I look at the new database \dt+ and there the size of this table is already there: 77 MB
At the same time, the number of records is the same
. What could be the reasons for such differences? Where to look?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vreitech, 2019-12-12
@caution

the volume occupied by the table is not only valuable fur, but also 30-40 megabytes (and sometimes more) of space not freed after deleting records.
discover vacuum full, pgcompactor and other anti-bloating tools (not to be confused with bullying).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question