pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
autovacuum recommendations for Large tables
8+ messages / 6 participants
[nested] [flat]

* autovacuum recommendations for Large tables
@ 2020-11-16 17:38  Atul Kumar <akumar14871@gmail.com>
  0 siblings, 2 replies; 8+ messages in thread

From: Atul Kumar @ 2020-11-16 17:38 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Hi,

I have a large table having no. of live tuples approx 7690798868 and
no. of dead tuples approx 114917737.

So Please share autovacuum tuning recommendations for this table so
that our time can be spent better than repeatedly vacuuming large
tables.


Please help.



Regards,
Atul





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: autovacuum recommendations for Large tables
@ 2020-11-16 18:28  Andreas Schmitz <mailinglist@longimanus.net>
  parent: Atul Kumar <akumar14871@gmail.com>
  1 sibling, 0 replies; 8+ messages in thread

From: Andreas Schmitz @ 2020-11-16 18:28 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

https://www.postgresql.org/docs/13/routine-vacuuming.html

Regards

Andreas

Am 11/16/2020 um 6:38 PM schrieb Atul Kumar:
> Hi,
>
> I have a large table having no. of live tuples approx 7690798868 and
> no. of dead tuples approx 114917737.
>
> So Please share autovacuum tuning recommendations for this table so
> that our time can be spent better than repeatedly vacuuming large
> tables.
>
>
> Please help.
>
>
>
> Regards,
> Atul
>
>





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: autovacuum recommendations for Large tables
@ 2020-11-16 22:57  Atul Kumar <akumar14871@gmail.com>
  parent: Atul Kumar <akumar14871@gmail.com>
  1 sibling, 1 reply; 8+ messages in thread

From: Atul Kumar @ 2020-11-16 22:57 UTC (permalink / raw)
  To: Olivier Gautherot <ogautherot@gautherot.net>; pgsql-general <pgsql-general@lists.postgresql.org>

Hi,

Could you help me by explaining in simple words, as I am new to postgres.

What value of which parameter should I set and why.

I only have this one big table in the database of size 3113 GB with rows
7661353111.

Right Now the autovacuum setting for that table is set to
{autovacuum_enabled=true,autovacuum_vacuum_scale_
factor=0.2,autovacuum_analyze_scale_factor=0.2}

Please help.






Regards
Atul






On Tuesday, November 17, 2020, Olivier Gautherot <ogautherot@gautherot.net>
wrote:

> Hi Atul,
>
> I would start with a factor of 0.00001 (10 parts per million) and explore
> down to 0.000001.
>
> I did some massive updates on a partition with 12 millions rows and my
> factor was 0.001.
>
> Depending on the number of big tables you have in the database, you may
> wish to reduce the number of parallel workers.
>
> Hope it helps
> --
> Olivier Gautherot
> Tel: +33 6 02 71 92 23
> https://www.linkedin.com/in/ogautherot/
>
>
>
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&...; Libre
> de virus. www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&...;
> <#m_-4472748644679516424_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> On Mon, Nov 16, 2020 at 8:20 PM Atul Kumar <akumar14871@gmail.com> wrote:
>
>> Ok,
>>
>> Right Now the autovacuum setting for that table is set to
>> {autovacuum_enabled=true,autovacuum_vacuum_scale_
>> factor=0.2,autovacuum_analyze_scale_factor=0.2}
>>
>>
>> So Please suggest, how much should i set atleast, to avoid increasing
>> in dead tuple.
>>
>>
>>
>> Regards,
>> Atul
>>
>>
>>
>> On 11/16/20, Olivier Gautherot <ogautherot@gautherot.net> wrote:
>> > Hi Atul,
>> >
>> > Le lun. 16 nov. 2020 à 18:38, Atul Kumar <akumar14871@gmail.com> a
>> écrit :
>> >
>> >> Hi,
>> >>
>> >> I have a large table having no. of live tuples approx 7690798868 and
>> >> no. of dead tuples approx 114917737.
>> >>
>> >> So Please share autovacuum tuning recommendations for this table so
>> >> that our time can be spent better than repeatedly vacuuming large
>> >> tables.
>> >>
>> >
>> > Vacuuming will affect you when it has a lot of work to do. I would try
>> to
>> > trigger an autovacuum every 10,000 insert/update to minimize the impact.
>> > You can play with the parameter autovacuum_vacuum_scale_factor for that
>> > table.
>> >
>> > Good luck
>> > Olivier
>> >
>>
>

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: autovacuum recommendations for Large tables
@ 2020-11-16 23:04  David G. Johnston <david.g.johnston@gmail.com>
  parent: Atul Kumar <akumar14871@gmail.com>
  0 siblings, 1 reply; 8+ messages in thread

From: David G. Johnston @ 2020-11-16 23:04 UTC (permalink / raw)
  To: Atul Kumar <akumar14871@gmail.com>; +Cc: Olivier Gautherot <ogautherot@gautherot.net>; pgsql-general <pgsql-general@lists.postgresql.org>

On Mon, Nov 16, 2020 at 3:57 PM Atul Kumar <akumar14871@gmail.com> wrote:

> I only have this one big table in the database of size 3113 GB with rows
> 7661353111.
>
> Right Now the autovacuum setting for that table is set to
>
> {autovacuum_enabled=true,autovacuum_vacuum_scale_factor=0.2,autovacuum_analyze_scale_factor=0.2}
>
>>
>>>
auto-vacuum doesn't care directly about absolute size, it cares about
change (relative to absolute size in many cases, hence the scale factors).

David J.

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: autovacuum recommendations for Large tables
@ 2020-11-17 21:17  Olivier Gautherot <ogautherot@gautherot.net>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 2 replies; 8+ messages in thread

From: Olivier Gautherot @ 2020-11-17 21:17 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Atul Kumar <akumar14871@gmail.com>; pgsql-general <pgsql-general@lists.postgresql.org>

Hi Atul,

On Tue, Nov 17, 2020 at 12:05 AM David G. Johnston <
david.g.johnston@gmail.com> wrote:

> On Mon, Nov 16, 2020 at 3:57 PM Atul Kumar <akumar14871@gmail.com> wrote:
>
>> I only have this one big table in the database of size 3113 GB with rows
>> 7661353111.
>>
>> Right Now the autovacuum setting for that table is set to
>>
>> {autovacuum_enabled=true,autovacuum_vacuum_scale_factor=0.2,autovacuum_analyze_scale_factor=0.2}
>>
>>>
>>>>
> auto-vacuum doesn't care directly about absolute size, it cares about
> change (relative to absolute size in many cases, hence the scale factors).
>
> David J.
>

David is correct.

If it helps, I put together a few thoughts and own experience on a blog:
https://sites.google.com/gautherot.net/postgresql/vacuum

Hope you find it useful.
--
Olivier Gautherot


<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&...;
Libre
de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&...;
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: autovacuum recommendations for Large tables
@ 2020-11-17 21:24  Rob Sargent <robjsargent@gmail.com>
  parent: Olivier Gautherot <ogautherot@gautherot.net>
  1 sibling, 1 reply; 8+ messages in thread

From: Rob Sargent @ 2020-11-17 21:24 UTC (permalink / raw)
  To: Olivier Gautherot <ogautherot@gautherot.net>; +Cc: David G. Johnston <david.g.johnston@gmail.com>; Atul Kumar <akumar14871@gmail.com>; pgsql-general <pgsql-general@lists.postgresql.org>



> 
> If it helps, I put together a few thoughts and own experience on a blog:
> https://sites.google.com/gautherot.net/postgresql/vacuum <https://sites.google.com/gautherot.net/postgresql/vacuum; 
> 
> Hope you find it useful.
> --

That URL does not work for me (not even https://sites.google.com/gautherot.net <https://sites.google.com/gautherot.net;)

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: autovacuum recommendations for Large tables
@ 2020-11-17 21:52  Olivier Gautherot <ogautherot@gautherot.net>
  parent: Rob Sargent <robjsargent@gmail.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Olivier Gautherot @ 2020-11-17 21:52 UTC (permalink / raw)
  To: Rob Sargent <robjsargent@gmail.com>; +Cc: David G. Johnston <david.g.johnston@gmail.com>; Atul Kumar <akumar14871@gmail.com>; pgsql-general <pgsql-general@lists.postgresql.org>

Hi Rob,

On Tue, Nov 17, 2020 at 10:24 PM Rob Sargent <robjsargent@gmail.com> wrote:

> If it helps, I put together a few thoughts and own experience on a blog:
> https://sites.google.com/gautherot.net/postgresql/vacuum
>
> Hope you find it useful.
> --
>
> That URL does not work for me (not even
> https://sites.google.com/gautherot.net)
>
>
Thanks  for the heads up - it looks like Google won't publish the site
outside of my domain.

I moved it to the old sites:
https://sites.google.com/a/gautherot.net/postgresql-tips/vacuum

Let's hope it works this time.

Cheers
Olivier

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&...;
Libre
de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&...;
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: autovacuum recommendations for Large tables
@ 2020-11-18 12:07  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Olivier Gautherot <ogautherot@gautherot.net>
  1 sibling, 0 replies; 8+ messages in thread

From: Laurenz Albe @ 2020-11-18 12:07 UTC (permalink / raw)
  To: Olivier Gautherot <ogautherot@gautherot.net>; David G. Johnston <david.g.johnston@gmail.com>; +Cc: Atul Kumar <akumar14871@gmail.com>; pgsql-general <pgsql-general@lists.postgresql.org>

On Tue, 2020-11-17 at 22:17 +0100, Olivier Gautherot wrote:
> On Tue, Nov 17, 2020 at 12:05 AM David G. Johnston <david.g.johnston@gmail.com> wrote:
> > On Mon, Nov 16, 2020 at 3:57 PM Atul Kumar <akumar14871@gmail.com> wrote:
> > > I only have this one big table in the database of size 3113 GB with rows 7661353111.
> > > 
> > > Right Now the autovacuum setting for that table is set to
> > > {autovacuum_enabled=true,autovacuum_vacuum_scale_factor=0.2,autovacuum_analyze_scale_factor=0.2}
> > 
> > auto-vacuum doesn't care directly about absolute size, it cares about change (relative to absolute size in many cases, hence the scale factors).
> > 
> > David J.
> > 
> 
> David is correct.
> 
> If it helps, I put together a few thoughts and own experience on a blog:
> https://sites.google.com/gautherot.net/postgresql/vacuum 
> 
> Hope you find it useful.

Then I can chime in with https://www.cybertec-postgresql.com/en/tuning-autovacuum-postgresql/

Yours,
Laurenz Albe






^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2020-11-18 12:07 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 17:38 autovacuum recommendations for Large tables Atul Kumar <akumar14871@gmail.com>
2020-11-16 18:28 ` Andreas Schmitz <mailinglist@longimanus.net>
2020-11-16 22:57 ` Atul Kumar <akumar14871@gmail.com>
2020-11-16 23:04   ` David G. Johnston <david.g.johnston@gmail.com>
2020-11-17 21:17     ` Olivier Gautherot <ogautherot@gautherot.net>
2020-11-17 21:24       ` Rob Sargent <robjsargent@gmail.com>
2020-11-17 21:52         ` Olivier Gautherot <ogautherot@gautherot.net>
2020-11-18 12:07       ` Laurenz Albe <laurenz.albe@cybertec.at>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox