pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Missing mention of autovacuum_work_mem
11+ messages / 5 participants
[nested] [flat]

* Missing mention of autovacuum_work_mem
@ 2021-03-11 09:07  PG Doc comments form <noreply@postgresql.org>
  0 siblings, 0 replies; 11+ messages in thread

From: PG Doc comments form @ 2021-03-11 09:07 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: nikolai.berkoff@pm.me

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/13/progress-reporting.html
Description:

The "vacuuming indexes" documentation has:

"If a table has any indexes, this will happen at least once per vacuum,
after the heap has been completely scanned. It may happen multiple times per
vacuum if maintenance_work_mem is insufficient to store the number of dead
tuples found."

should be something like

"If a table has any indexes, this will happen at least once per vacuum,
after the heap has been completely scanned. It may happen multiple times per
vacuum if the maximum memory is insufficient to store the number of dead
tuples found.  The maximum memory is set via the maintenance_work_mem unless
it is an autovacuum then autovacuum_work_mem will be used."


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

* Re: Missing mention of autovacuum_work_mem
@ 2021-09-20 08:07  nikolai.berkoff <nikolai.berkoff@pm.me>
  0 siblings, 1 reply; 11+ messages in thread

From: nikolai.berkoff @ 2021-09-20 08:07 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

Hi,

There was no follow up to my message below so I'm raising it again.  


I can see in
src/backend/access/heap/vacuumlazy.c
that compute_max_dead_tuples uses autovacuum_work_mem when it is given.


> The "vacuuming indexes" documentation has:
> 

> "If a table has any indexes, this will happen at least once per vacuum,
> after the heap has been completely scanned. It may happen multiple times per
> vacuum if maintenance_work_mem is insufficient to store the number of dead
> tuples found."
> 

> should be something like
> 


(I've changed this slightly and removed maximum as it seems redundant)

"If a table has any indexes, this will happen at least once per vacuum,
after the heap has been completely scanned. It may happen multiple times per
vacuum if the memory is insufficient to store the number of dead
tuples found. The memory is set via the maintenance_work_mem unless
it is an autovacuum then autovacuum_work_mem will be used."

Attachments:

  [application/pgp-keys] publickey - nikolai.berkoff@pm.me - 0xD189792D.asc (1.8K, ../../1kIqf6Q1G-wVkQkeg_BRSpcmy77hNfh9vlLQ3AF1APT-pKHRYT3z1IuDC5K2w83-4Qa016V1SfWJfF1v0Z0qf6141DbLcpIZJY3edlBEkCs=@pm.me/2-publickey%20-%20nikolai.berkoff@pm.me%20-%200xD189792D.asc)
  download

  [application/pgp-signature] signature.asc (507B, ../../1kIqf6Q1G-wVkQkeg_BRSpcmy77hNfh9vlLQ3AF1APT-pKHRYT3z1IuDC5K2w83-4Qa016V1SfWJfF1v0Z0qf6141DbLcpIZJY3edlBEkCs=@pm.me/3-signature.asc)
  download

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

* Re: Missing mention of autovacuum_work_mem
@ 2021-09-20 13:09  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: nikolai.berkoff <nikolai.berkoff@pm.me>
  0 siblings, 1 reply; 11+ messages in thread

From: Laurenz Albe @ 2021-09-20 13:09 UTC (permalink / raw)
  To: nikolai.berkoff <nikolai.berkoff@pm.me>; pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

On Mon, 2021-09-20 at 08:07 +0000, nikolai.berkoff wrote:
> I can see in
> src/backend/access/heap/vacuumlazy.c
> that compute_max_dead_tuples uses autovacuum_work_mem when it is given.
>
> The "vacuuming indexes" documentation has:
>
> > "If a table has any indexes, this will happen at least once per vacuum,
> > after the heap has been completely scanned. It may happen multiple times per
> > vacuum if maintenance_work_mem is insufficient to store the number of dead
> > tuples found."

Your suggested change is:

> "If a table has any indexes, this will happen at least once per vacuum,
> after the heap has been completely scanned. It may happen multiple times per
> vacuum if the memory is insufficient to store the number of dead
> tuples found. The memory is set via the maintenance_work_mem unless
> it is an autovacuum then autovacuum_work_mem will be used."

Why not keep it simple with

"If a table has any indexes, this will happen at least once per vacuum,
 after the heap has been completely scanned. It may happen multiple times per
 vacuum if maintenance_work_mem (or, in the case of autovacuum,
 autovacuum_work_mem) is insufficient to store the number of dead
 tuples found."

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






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

* Re: Missing mention of autovacuum_work_mem
@ 2021-09-20 13:40  nikolai.berkoff <nikolai.berkoff@pm.me>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 11+ messages in thread

From: nikolai.berkoff @ 2021-09-20 13:40 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

> Why not keep it simple with
> 

> "If a table has any indexes, this will happen at least once per vacuum,
> 

> after the heap has been completely scanned. It may happen multiple times per
> 

> vacuum if maintenance_work_mem (or, in the case of autovacuum,
> 

> autovacuum_work_mem) is insufficient to store the number of dead
> 

> tuples found."

Thank you Laurenz,

Yes that reads better still.

Regards,

Nikolai

Attachments:

  [application/pgp-signature] signature.asc (507B, ../../2a_0HzEWsHbu9VVZKMxdZ-YxVvFqamXG4crWy1xNkE4NIF-VjRuquYqzrNzmq8-2kJorJymk1D7CDbC2JgYA-BBGibPcxzWQ6R1WTtGMacE=@pm.me/2-signature.asc)
  download

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

* Re: Missing mention of autovacuum_work_mem
@ 2021-09-22 20:45  Euler Taveira <euler@eulerto.com>
  parent: nikolai.berkoff <nikolai.berkoff@pm.me>
  0 siblings, 1 reply; 11+ messages in thread

From: Euler Taveira @ 2021-09-22 20:45 UTC (permalink / raw)
  To: nikolai.berkoff <nikolai.berkoff@pm.me>; Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

On Mon, Sep 20, 2021, at 10:40 AM, nikolai.berkoff wrote:
> Yes that reads better still.
I'm attaching a patch with Laurenz's words.


--
Euler Taveira
EDB   https://www.enterprisedb.com/

Attachments:

  [text/x-patch] v1-0001-Improve-vacumming-indexes-description.patch (1.4K, ../../e6deef8f-e165-4ba5-b48f-80ba8e2d4b51@www.fastmail.com/3-v1-0001-Improve-vacumming-indexes-description.patch)
  download | inline diff:
From 41f814b15349bcc8eb8ffa4624ed5af80f3476ac Mon Sep 17 00:00:00 2001
From: Euler Taveira <euler.taveira@enterprisedb.com>
Date: Wed, 22 Sep 2021 14:47:12 -0300
Subject: [PATCH v1] Improve vacumming indexes description

Mention autovacuum_work_mem if VACUUM is run by autovacuum.

Reported-by: Nikolai Berkoff
Author: Laurenz Albe
Reviewed-by: Nikolai Berkoff
Discussion: https://postgr.es/m/1kIqf6Q1G-wVkQkeg_BRSpcmy77hNfh9vlLQ3AF1APT-pKHRYT3z1IuDC5K2w83-4Qa016V1SfWJfF1v0Z0qf6141DbLcpIZJY3edlBEkCs%3D%40pm.me
---
 doc/src/sgml/monitoring.sgml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 2281ba120f..451534602b 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -6147,8 +6147,9 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
        <command>VACUUM</command> is currently vacuuming the indexes.  If a table has
        any indexes, this will happen at least once per vacuum, after the heap
        has been completely scanned.  It may happen multiple times per vacuum
-       if <xref linkend="guc-maintenance-work-mem"/> is insufficient to
-       store the number of dead tuples found.
+       if <xref linkend="guc-maintenance-work-mem"/> (or, in the case of autovacuum,
+       <xref linkend="guc-autovacuum-work-mem"/>) is insufficient to store the number
+       of dead tuples found.
      </entry>
     </row>
     <row>
-- 
2.20.1



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

* Re: Missing mention of autovacuum_work_mem
@ 2021-09-23 08:48  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Euler Taveira <euler@eulerto.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Laurenz Albe @ 2021-09-23 08:48 UTC (permalink / raw)
  To: Euler Taveira <euler@eulerto.com>; nikolai.berkoff <nikolai.berkoff@pm.me>; +Cc: pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

On Wed, 2021-09-22 at 17:45 -0300, Euler Taveira wrote:
> On Mon, Sep 20, 2021, at 10:40 AM, nikolai.berkoff wrote:
> > Yes that reads better still.
> I'm attaching a patch with Laurenz's words.

Thanks, and +1 from me.

Yours,
Laurenz Albe






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

* Re: Missing mention of autovacuum_work_mem
@ 2021-09-23 10:18  Michael Paquier <michael@paquier.xyz>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 11+ messages in thread

From: Michael Paquier @ 2021-09-23 10:18 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Euler Taveira <euler@eulerto.com>; nikolai.berkoff <nikolai.berkoff@pm.me>; pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

On Thu, Sep 23, 2021 at 10:48:37AM +0200, Laurenz Albe wrote:
> Thanks, and +1 from me.

maintenance_work_mem would be used in the context of autovacuum if
autovacuum_work_mem is -1, but it seems to me that the suggested
wording sounds like only autovacuum_work_mem is used and that it would
never fall back to maintenance_work_mem, no?  I would suggest the
addition of "if specified" in the new part within parenthesis
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../../YUxUj38VIKsBPoa3@paquier.xyz/2-signature.asc)
  download

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

* Re: Missing mention of autovacuum_work_mem
@ 2021-09-24 15:21  Euler Taveira <euler@eulerto.com>
  parent: Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 11+ messages in thread

From: Euler Taveira @ 2021-09-24 15:21 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: nikolai.berkoff <nikolai.berkoff@pm.me>; pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

On Thu, Sep 23, 2021, at 7:18 AM, Michael Paquier wrote:
> On Thu, Sep 23, 2021 at 10:48:37AM +0200, Laurenz Albe wrote:
> > Thanks, and +1 from me.
> 
> maintenance_work_mem would be used in the context of autovacuum if
> autovacuum_work_mem is -1, but it seems to me that the suggested
> wording sounds like only autovacuum_work_mem is used and that it would
> never fall back to maintenance_work_mem, no?  I would suggest the
> addition of "if specified" in the new part within parenthesis
> 
Good point. However, I prefer "if set".


--
Euler Taveira
EDB   https://www.enterprisedb.com/

Attachments:

  [text/x-patch] v2-0001-Improve-vacumming-indexes-description.patch (1.5K, ../../5e51539f-e4b6-4b46-b995-23a2c17252e8@www.fastmail.com/3-v2-0001-Improve-vacumming-indexes-description.patch)
  download | inline diff:
From fb9672d58520f452b27f1747d2ed13ddf9f5658e Mon Sep 17 00:00:00 2001
From: Euler Taveira <euler.taveira@enterprisedb.com>
Date: Wed, 22 Sep 2021 14:47:12 -0300
Subject: [PATCH v2] Improve vacumming indexes description

Mention autovacuum_work_mem if VACUUM is run by autovacuum.

Reported-by: Nikolai Berkoff
Author: Laurenz Albe
Reviewed-by: Nikolai Berkoff, Michael Paquier, Euler Taveira
Discussion: https://postgr.es/m/1kIqf6Q1G-wVkQkeg_BRSpcmy77hNfh9vlLQ3AF1APT-pKHRYT3z1IuDC5K2w83-4Qa016V1SfWJfF1v0Z0qf6141DbLcpIZJY3edlBEkCs%3D%40pm.me
---
 doc/src/sgml/monitoring.sgml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml
index 2281ba120f..c2f2a3a7a8 100644
--- a/doc/src/sgml/monitoring.sgml
+++ b/doc/src/sgml/monitoring.sgml
@@ -6147,8 +6147,9 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
        <command>VACUUM</command> is currently vacuuming the indexes.  If a table has
        any indexes, this will happen at least once per vacuum, after the heap
        has been completely scanned.  It may happen multiple times per vacuum
-       if <xref linkend="guc-maintenance-work-mem"/> is insufficient to
-       store the number of dead tuples found.
+       if <xref linkend="guc-maintenance-work-mem"/> (or, in the case of autovacuum,
+       <xref linkend="guc-autovacuum-work-mem"/>, if set) is insufficient to store
+       the number of dead tuples found.
      </entry>
     </row>
     <row>
-- 
2.20.1



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

* Re: Missing mention of autovacuum_work_mem
@ 2021-09-24 22:51  Michael Paquier <michael@paquier.xyz>
  parent: Euler Taveira <euler@eulerto.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Michael Paquier @ 2021-09-24 22:51 UTC (permalink / raw)
  To: Euler Taveira <euler@eulerto.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; nikolai.berkoff <nikolai.berkoff@pm.me>; pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

On Fri, Sep 24, 2021 at 12:21:40PM -0300, Euler Taveira wrote:
> Good point. However, I prefer "if set".

WFM.
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../../YU5WY%2FSZwyRc0AGC@paquier.xyz/2-signature.asc)
  download

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

* Re: Missing mention of autovacuum_work_mem
@ 2021-09-27 00:25  Michael Paquier <michael@paquier.xyz>
  parent: Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 11+ messages in thread

From: Michael Paquier @ 2021-09-27 00:25 UTC (permalink / raw)
  To: Euler Taveira <euler@eulerto.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; nikolai.berkoff <nikolai.berkoff@pm.me>; pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

On Sat, Sep 25, 2021 at 07:51:15AM +0900, Michael Paquier wrote:
> WFM.

This has been applied and backpatched as of 1ba8410.
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../../YVEPg3kwlbiljH4n@paquier.xyz/2-signature.asc)
  download

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

* Re: Missing mention of autovacuum_work_mem
@ 2021-09-27 11:35  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 11+ messages in thread

From: Laurenz Albe @ 2021-09-27 11:35 UTC (permalink / raw)
  To: Michael Paquier <michael@paquier.xyz>; Euler Taveira <euler@eulerto.com>; +Cc: nikolai.berkoff <nikolai.berkoff@pm.me>; pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>

On Mon, 2021-09-27 at 09:25 +0900, Michael Paquier wrote:
> On Sat, Sep 25, 2021 at 07:51:15AM +0900, Michael Paquier wrote:
> > WFM.
> 
> This has been applied and backpatched as of 1ba8410.

Thank you!

Yours,
Laurenz Albe






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


end of thread, other threads:[~2021-09-27 11:35 UTC | newest]

Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 09:07 Missing mention of autovacuum_work_mem PG Doc comments form <noreply@postgresql.org>
2021-09-20 08:07 Re: Missing mention of autovacuum_work_mem nikolai.berkoff <nikolai.berkoff@pm.me>
2021-09-20 13:09 ` Laurenz Albe <laurenz.albe@cybertec.at>
2021-09-20 13:40   ` nikolai.berkoff <nikolai.berkoff@pm.me>
2021-09-22 20:45     ` Euler Taveira <euler@eulerto.com>
2021-09-23 08:48       ` Laurenz Albe <laurenz.albe@cybertec.at>
2021-09-23 10:18         ` Michael Paquier <michael@paquier.xyz>
2021-09-24 15:21           ` Euler Taveira <euler@eulerto.com>
2021-09-24 22:51             ` Michael Paquier <michael@paquier.xyz>
2021-09-27 00:25               ` Michael Paquier <michael@paquier.xyz>
2021-09-27 11:35                 ` 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