Re: Fix pg_buffercache document

From: Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fix pg_buffercache document
Date: 2020-05-07 09:22:42
Message-ID: CA+fd4k6EmOnHA4XLp-cfaCmZ-=b5PU_79O=myn=jFf45yw_SSA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 7 May 2020 at 18:12, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Thu, May 7, 2020 at 2:23 PM Masahiko Sawada
> <masahiko(dot)sawada(at)2ndquadrant(dot)com> wrote:
> >
> > Hi,
> >
> > The following description in pg_buffercace is no longer true.
> >
> > When the pg_buffercache view is accessed, internal buffer manager
> > locks are taken for long enough to copy all the buffer state data that
> > the view will display. This ensures that the view produces a
> > consistent set of results, while not blocking normal buffer activity
> > longer than necessary. Nonetheless there could be some impact on
> > database performance if this view is read often.
> >
> > We changed pg_buffercache_page so that it doesn't take buffer manager
> > locks in commit 6e654546fb6. Therefore from version 10,
> > pg_buffercache_page has less impact on normal buffer activity less but
> > might not return a consistent snapshot across all buffers instead.
> >
>
> +1.
>
> There is a typo in the patch (queris/queries). How about if slightly
> reword it as "Since buffer manager locks are not taken to copy the
> buffer state data that the view will display, accessing
> <structname>pg_buffercache</structname> view has less impact on normal
> buffer activity but it doesn't provide a consistent set of results
> across all buffers. However, we ensure that the information of each
> buffer is self-consistent."?

Thank you for your idea. Agreed.

Attached the updated version patch.

Regards,

--
Masahiko Sawada http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
pg_buffercache_doc_v2.patch application/octet-stream 1.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message دار الآثار للنشر والتوزيع-صنعاء Dar Alathar-Yemen 2020-05-07 10:23:35 رد: BUG #16419: wrong parsing BC year in to_date() function
Previous Message Marc Rechté 2020-05-07 09:12:56 min_wal_size > max_wal_size is accepted