Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGJoc-002CxY-0o for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Nov 2024 15:18:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tGJoa-00Fv9N-K3 for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Nov 2024 15:18:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGIRF-00Ewvz-Fy for pgsql-hackers@lists.postgresql.org; Wed, 27 Nov 2024 13:50:41 +0000 Received: from mail-4322.protonmail.ch ([185.70.43.22]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGIRC-004ANq-EQ for pgsql-hackers@lists.postgresql.org; Wed, 27 Nov 2024 13:50:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1732715434; x=1732974634; bh=8C4gdwq7fdTnPEHJV/P/Kdwyy44QWM1SxkMLda2EUFc=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=Wo72G6aD3q5rAMXOV3LTazbj/6AcxwvvJs66JEL62Wr6J5uR0nxhYV8OL5O4bVcvw H8tIEEqyz7zjY477tOmKIUq8yLFhcTA4yzh/M/6QHUrz6nUYo6Z7et1Hs+6Dnh/ImF 4ALjbV12lQKo7YPex+eS3KFcfearOy97FlCKcVFOpbsAh89OlXa04KL/c0wFil+7zM H1glTLwEN708vDzCb5VqQ8xc/0DaAht0L1CZeXsvGM6AJkp16r3VgDGoz7JbbHDOlV JVV8DNL/t1yOApnEmPth9pQQ0884MJwfn8xTvhm0HEPNTjZyt5Qg8DunQ29ePOL2Kk 0bld+1fDjHh/g== Date: Wed, 27 Nov 2024 13:50:29 +0000 To: Nazir Bilal Yavuz From: Matheus Alcantara Cc: PostgreSQL Hackers Subject: Re: Using read stream in autoprewarm Message-ID: In-Reply-To: References: Feedback-ID: 43350915:user:proton X-Pm-Message-ID: 164ea7a0952e06cbd9fa0ddab5bdf764c0d117a0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 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 a= nd 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 wo= rks 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 re= ad stream API and Postgresql hacking itself. Just some minor points and questi= ons 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 + *=09=09=09=09=09=09=09=09 buffers in buffer pool. + * + * Note that result continuosly changes as free buffers are moved out by o= ther + * operations. + */ +int +get_number_of_free_buffers(void) typo on continuosly -> continuously v2-0001-Use-read-stream-in-autoprewarm.patch +=09bool=09 *rs_have_free_buffer =3D per_buffer_data; + + +=09*rs_have_free_buffer =3D true; + Not sure if I understand why this variable is needed, it seems that it is o= nly 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