public inbox for [email protected]  
help / color / mirror / Atom feed
From: Matheus Alcantara <[email protected]>
To: Nazir Bilal Yavuz <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Using read stream in autoprewarm
Date: Wed, 27 Nov 2024 13:50:29 +0000
Message-ID: <xB8mjPxwcpQNKrrrQLcFPN61ZwWyRd18C02ELlwcWVdvl9zRrkEXOj5vSAlsaXOIyUZ_qZHpmRnUCy88_4fm9GQzUTq4mFLbiowLYJh9SDY=@pm.me> (raw)
In-Reply-To: <CAN55FZ3n8Gd+hajbL=5UkGzu_aHGRqnn+xktXq2fuds=1AOR6Q@mail.gmail.com>
References: <CAN55FZ3n8Gd+hajbL=5UkGzu_aHGRqnn+xktXq2fuds=1AOR6Q@mail.gmail.com>

Hi,

Newer reviewer here, trying to understand more about the read stream API.

On Tuesday, November 26th, 2024 at 11:07 AM, Nazir Bilal Yavuz <[email protected]> wrote:

> Any feedback would be appreciated.

I've executed the same test of 5 databases with each of them having 1 table of
3GB of size and I've got very similar results.

I've also tested using a single database with 4 tables with ~60GB of size and
the results compared with master was more closer but still an improvement. Note
that I've also increased the default shared_buffers to 7GB to see how it works
with large buffer pools.
  - patched: 5.4259 s
  - master: 5.53186 s

Not to much to say about the code, I'm currently learning more about the read
stream API and Postgresql hacking itself. Just some minor points and questions
about the patches.


v2-0002-Count-free-buffers-at-the-start-of-the-autoprewar.patch
--- a/src/backend/storage/buffer/freelist.c
+/*
+ * get_number_of_free_buffers -- a lockless way to get the number of free
+ *								 buffers in buffer pool.
+ *
+ * Note that result continuosly changes as free buffers are moved out by other
+ * operations.
+ */
+int
+get_number_of_free_buffers(void)

typo on continuosly -> continuously


v2-0001-Use-read-stream-in-autoprewarm.patch
+	bool	   *rs_have_free_buffer = per_buffer_data;
+
+
+	*rs_have_free_buffer = true;
+

Not sure if I understand why this variable is needed, it seems that it is only
written and never read? Just as comparison, the block_range_read_stream_cb
callback used on pg_prewarm seems to not use the per_buffer_data parameter.


--
Matheus Alcantara
EDB: https://www.enterprisedb.com






view thread (3+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Using read stream in autoprewarm
  In-Reply-To: <xB8mjPxwcpQNKrrrQLcFPN61ZwWyRd18C02ELlwcWVdvl9zRrkEXOj5vSAlsaXOIyUZ_qZHpmRnUCy88_4fm9GQzUTq4mFLbiowLYJh9SDY=@pm.me>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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