Solved: Table : Bloat grow high

From: Alexis Zapata <alexise23(at)hotmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Solved: Table : Bloat grow high
Date: 2022-12-06 03:01:57
Message-ID: BLAPR19MB4626A5D2E0CFD69D433CEE0DA11B9@BLAPR19MB4626.namprd19.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, minx was freeze or stop because some transactions showed state "idle in transaction" continuously, for it to the frequency of vacuum execution has been increased all tables, and this caused minx in the table to be updated and the queries improved a lot and the transactions with state "idle in transaction" did not continue.

Thank you all
Best regards

________________________________
De: Alexis Zapata <alexise23(at)hotmail(dot)com>
Enviado: domingo, 13 de noviembre de 2022 9:50 a. m.
Para: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>; pgsql-general(at)lists(dot)postgresql(dot)org <pgsql-general(at)lists(dot)postgresql(dot)org>
Asunto: RE: Table : Bloat grow high

Hi Laurenz ,
I found that xmin does not change when running the vacuum.

________________________________
De: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Enviado: sábado, 12 de noviembre de 2022 9:05 a. m.
Para: Alexis Zapata <alexise23(at)hotmail(dot)com>; pgsql-general(at)lists(dot)postgresql(dot)org <pgsql-general(at)lists(dot)postgresql(dot)org>
Asunto: Re: Table : Bloat grow high

On Fri, 2022-11-11 at 17:09 +0000, Alexis Zapata wrote:
> In postgresql 13.5 I have a table (size 3.1 GB) and in this table occurs near to
> 200 updates per second, after 2 days the size table is 7 GB and bloat grow to 45% and
> the query operations are degraded. vacuum runs every 5 seconds over this. but the
> bloat growth continues, to solve the
> problem quickly, we have made a replica of the table with a trigger, then a copy
> of the data and in a
> transaction we rename the table, but it would not be the best solution.
> Some suggestion about stop this size increase or parameter to setting up?

You'd be most happy with HOT updates. Make sure that there is no index on any of
the columns you update, and change the table to have a "fillfactor" less than
100. Then you can get HOT updates which don't require VACUUM for cleaning up.

https://www.cybertec-postgresql.com/en/hot-updates-in-postgresql-for-better-performance/

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message hvjunk 2022-12-06 04:44:15 Re: postgres large database backup
Previous Message Nunya Business 2022-12-05 19:49:40 PG 14.5 -- Impossible to restore dump due to interaction/order of views, functions, and generated columns