Re: TOAST Table / Dead Tuples / Free Pages - Mailing list pgsql-general

From Kashif Zeeshan
Subject Re: TOAST Table / Dead Tuples / Free Pages
Date
Msg-id CAAPsdhfgtid0=b4j0xC=MNG1tpQrMxL6OJb9GHm+PC7jVQG+WA@mail.gmail.com
Whole thread Raw
In response to TOAST Table / Dead Tuples / Free Pages  ("Shenavai, Manuel" <manuel.shenavai@sap.com>)
Responses Re: TOAST Table / Dead Tuples / Free Pages
Re: TOAST Table / Dead Tuples / Free Pages
List pgsql-general
Hi

You can use the CLUSTER command, which will physically reorder the table based on index, effectively reducing the size of the table without using VACUUM.

CLUSTER your_table USING your_index;

Or you can use the pg_repack extension as well.

pg_repack -d your_database -t your_table

Regards
Kashif Zeeshan



On Thu, Jun 13, 2024 at 12:55 PM Shenavai, Manuel <manuel.shenavai@sap.com> wrote:

Hi everyone,

 

I created a simple scenario to understand the handling of TOASTs: There is an empty database with a single table and record. The single record gets updated multiple times with 10MB (bytea column). I can see that the table/toasttable size is growing (500MB).

 

Now I tried to find a way to get the DB size down again (it should be around 10MB instead of 500MB). I don’t want to use VACUUM FULL due to the exclusive lock.

 

Is there any way to remove the dead tuples and free the pages?

 

Thanks in advance &

Best regards,

Manuel

 

pgsql-general by date:

Previous
From: "Shenavai, Manuel"
Date:
Subject: TOAST Table / Dead Tuples / Free Pages
Next
From: Muhammad Ikram
Date:
Subject: Re: TOAST Table / Dead Tuples / Free Pages