Re: Add shared buffer hits to pg_stat_io

Поиск
Список
Период
Сортировка
От Melanie Plageman
Тема Re: Add shared buffer hits to pg_stat_io
Дата
Msg-id CAAKRu_ae5R5PL2XhOkB-ckyv3s7JMojK8YG9xt-JE6ey3YogJA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add shared buffer hits to pg_stat_io  ("Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>)
Ответы Re: Add shared buffer hits to pg_stat_io  ("Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>)
Re: Add shared buffer hits to pg_stat_io  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Thanks for the review!

On Tue, Feb 28, 2023 at 7:36 AM Drouvot, Bertrand
<bertranddrouvot.pg@gmail.com> wrote:
>   BufferDesc *
>   LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum,
> -                                bool *foundPtr, IOContext *io_context)
> +                                bool *foundPtr, IOContext io_context)
>   {
>          BufferTag       newTag;                 /* identity of requested block */
>          LocalBufferLookupEnt *hresult;
> @@ -128,14 +128,6 @@ LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum,
>          hresult = (LocalBufferLookupEnt *)
>                  hash_search(LocalBufHash, &newTag, HASH_FIND, NULL);
>
> -       /*
> -        * IO Operations on local buffers are only done in IOCONTEXT_NORMAL. Set
> -        * io_context here (instead of after a buffer hit would have returned) for
> -        * convenience since we don't have to worry about the overhead of calling
> -        * IOContextForStrategy().
> -        */
> -       *io_context = IOCONTEXT_NORMAL;
>
>
> It looks like that io_context is not used in LocalBufferAlloc() anymore and then can be removed as an argument.

Good catch. Updated patchset attached.

> > While adding this, I noticed that I had made all of the IOOP columns
> > int8 in the view, and I was wondering if this is sufficient for hits (I
> > imagine you could end up with quite a lot of those).
> >
>
> I think that's ok and bigint is what is already used for pg_statio_user_tables.heap_blks_hit for example.

Ah, I was silly and didn't understand that the SQL type int8 is eight
bytes and not 1. That makes a lot of things make more sense :)

https://www.postgresql.org/docs/current/xfunc-c.html#XFUNC-C-TYPE-TABLE

- Melanie

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Combine pg_walinspect till_end_of_wal functions with others
Следующее
От: Jelte Fennema
Дата:
Сообщение: Re: [EXTERNAL] Re: Add non-blocking version of PQcancel