public inbox for [email protected]
help / color / mirror / Atom feedFrom: Muhammad Ikram <[email protected]>
To: Kashif Zeeshan <[email protected]>
Cc: Shenavai, Manuel <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: TOAST Table / Dead Tuples / Free Pages
Date: Thu, 13 Jun 2024 13:41:52 +0500
Message-ID: <CAGeimVpXOiirUwJXvr=dBHb8X8-aJ5zcGZoPCNqnc_6Jx0MB8w@mail.gmail.com> (raw)
In-Reply-To: <CAAPsdhfgtid0=b4j0xC=MNG1tpQrMxL6OJb9GHm+PC7jVQG+WA@mail.gmail.com>
References: <AM9PR02MB7410F60E0B73567795B4D034E8C12@AM9PR02MB7410.eurprd02.prod.outlook.com>
<CAAPsdhfgtid0=b4j0xC=MNG1tpQrMxL6OJb9GHm+PC7jVQG+WA@mail.gmail.com>
Hi Shenavai,
Here are some more options..
VACUUM <your tablename>
VACUUM FULL <your tablename>
You may also reindex to reclaim space
REINDEX TABLE <your tablename>
REINDEX INDEX <indexname>
Regards,
Muhammad Ikram
Bitnine
On Thu, Jun 13, 2024 at 1:09 PM Kashif Zeeshan <[email protected]>
wrote:
> 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 <[email protected]>
> wrote:
>
>> Hi everyone,
>>
>>
>>
>> I created a simple scenario to understand the handling of TOASTs
>> <https://www.postgresql.org/docs/current/storage-toast.html;: 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
>>
>>
>>
>
--
Muhammad Ikram
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: TOAST Table / Dead Tuples / Free Pages
In-Reply-To: <CAGeimVpXOiirUwJXvr=dBHb8X8-aJ5zcGZoPCNqnc_6Jx0MB8w@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox