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 1uQ3Jd-003ORp-Ek for pgsql-performance@arkaria.postgresql.org; Fri, 13 Jun 2025 12:15:25 +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 1uQ3Jb-0032oT-Gj for pgsql-performance@arkaria.postgresql.org; Fri, 13 Jun 2025 12:15:24 +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 1uQ3Jb-0032oL-6V for pgsql-performance@lists.postgresql.org; Fri, 13 Jun 2025 12:15:23 +0000 Received: from mout.gmx.net ([212.227.17.22]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uQ3JZ-001mMX-2I for pgsql-performance@postgresql.org; Fri, 13 Jun 2025 12:15:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1749816919; x=1750421719; i=jimis@gmx.net; bh=DDbSEOTHAhvNKNjY4rg5cWVqIQvATQqxHmHTQFXFYlI=; h=X-UI-Sender-Class:Date:From:To:cc:Subject:In-Reply-To:Message-ID: References:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=lU89SrqNB/YzNfVKaTKlY04DeUEIGqUvfMQLsr9He9dn8zzzf7wunWhWYzfV55ua LTfWy5QtW/KfDENg8dYaTkjIYAyof8GyR09vRH2gqdpg6mZUAExLkjl1Z6Oz9xxA7 QAzEF7DCieiiSlbahFGKzirRJPk0iCryHDremZzme7STVRABym5JffNyKeX8EniZj dxcFzYMtyAA2u/kgqEfVISSrAPjtEn/c3kGcKfWaySI8xHVSBbaFAletRhcGqZu9P iTQLBNPouHToZw2sNlA+4MySz3cA7FXRmz/KKlbtRFrqqa0DJDZKJPCAomOYESF17 RYBqEB3uMdLzKRTpXQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [10.9.70.81] ([185.55.106.54]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MvsJ5-1uhZrd1tGJ-010WV6; Fri, 13 Jun 2025 14:15:18 +0200 Date: Fri, 13 Jun 2025 14:15:17 +0200 (CEST) From: Dimitrios Apostolou To: Thomas Munro cc: pgsql-performance@postgresql.org Subject: Re: Performance implications of 8K pread()s In-Reply-To: Message-ID: <747a3cb2-ec15-d680-c95d-be5823aff934@gmx.net> References: <218fa2e0-bc58-e469-35dd-c5cb35906064@gmx.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-786393783-1749816918=:361063" X-Provags-ID: V03:K1:Mtxmfum/cY1ycGpthGSZlZQI5eSl2dhrBi5Ui7aBWylInkBom38 PVBGq88LBnF8mgAmeJaiLSUYWy9ZmL+wBQ3zfj78AqQHuTpbqSBWw9rHdRaBYetsWGxCLKs J1b6EnmeXSl7bGlV6VuJzkpAWDQ2+i2B3E/ZbCMlJPbqkKEXor6t0CFtdXWigwfk6Hi04BH m49nWPRYqVVARnHXiXTgg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:7f5cMg8WCEQ=;tpl0whibSx9vBLCauC+y1k54Y3r ByNGUo9JWAW+wv6S8738Cx1lhCO4fHcVamJB5065qlohNs5AjUxywsQlqq3IAkQEqRHq6v3GR qkXMEcuUdEugDul9MwDyGFaZGoF1jtQOcvR1fa/TFCHjToHWHQ2E+kzDfS2gP+jeE4OrWw/lY eKgrhtf5Ohn2RjpQB3tSTe67qhdG5TbO9p1u2EJ2KdEChPrsfa1O/PervWGZG46W3nfSxfI8v PlQ5cg2YEgGYg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Z3tkruh/J8s1+UFe9FfNQFgSDlYe5mTgqlJLgd14eAe z1bRFW2x38nZwVXeBfVxTXBPiT0aTg9EShpLRxjpXaAouzKGyrpWMu4fCmDuYu5OzIAQrngOl iigjfCPrzAuMgMtS6/6cLnR6E7ORKCZwgEtMzTaZj9zN5MdwRgAkebcaBpZyjMAnB4NmsXiWg cJJf+BRBewruvGmGHhsdWZcdDi8FOBz3dpuehhonTOQAXmLn7wG9/AxoSWknOkG50aVsfuu2+ +4kOvEqkUSGBq43aDSFIebTb6hoI83GHPDp4kgemfymc9fBrxoVhSFVlQ/GWMBhlzAMXQUxqn PM5mhcyv54RJLTTnVxtXWmaiKlJ7cSkhx9YGaeHt9G3NOX/8A2dmOA3TyJmhxnfsySiiwSEjV 3m4PHwkzPcU54timrOQu4T0OeFb2tphxRXOpPC8ytiIdgt1Bc5GbJISo01hLFXRFQGizNWkk6 /MS2f4VbsICQHqYiNkPighHPtpI1iABUojACzwwjFomr25zGuVELlcjdyamWTGXzhoU9hhZGZ AGxqRcGY3o/oLXVQ1x85bJS1arIxcykr7skFu/r3PJiCqsfAyf92jEnVmZafWsm40yU6oFoqX uG321cjsH9NNlwqEm1EQLQMInFdR/Jo4O1O/ymTHfgebuO5F7pn9salfCPHTpGMG3KahTkUrS oYVpayjzu0DpV9+k4NnF9T/R1fP8MidGxxSF59BtEjXjjohKgVZemjzT+6SZ3y/S2pt2nmj5q c6G2DY7szVELtCErQ6pIbk2KMWHnJiG0VGbXUwyVrOR6ENGzukEr+h1Vq3TE+YG/hgZdE2miq MC3/WVjWMUSva96x1sksHCfpplVBLXvGQr43eo/noy2buvg== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-786393783-1749816918=:361063 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On Fri, 12 Apr 2024, Thomas Munro wrote: > On Wed, Jul 12, 2023 at 1:11=E2=80=AFAM Dimitrios Apostolou wrote: >> So would it make sense for postgres to perform reads in bigger blocks? = Is it >> easy-ish to implement (where would one look for that)? Or must the I/O = unit be >> tied to postgres' page size? > > FYI as of last week we can do a little bit of that on the master branch: > > postgres=3D# select count(*) from t; > > preadv(46, ..., 8, 256237568) =3D 131072 > preadv(46, ..., 5, 256368640) =3D 131072 > preadv(46, ..., 8, 256499712) =3D 131072 > preadv(46, ..., 5, 256630784) =3D 131072 > > postgres=3D# set io_combine_limit =3D '256k'; > postgres=3D# select count(*) from t; > > preadv(47, ..., 5, 613728256) =3D 262144 > preadv(47, ..., 5, 613990400) =3D 262144 > preadv(47, ..., 5, 614252544) =3D 262144 > preadv(47, ..., 5, 614514688) =3D 262144 > > Here's hoping the commits implementing this stick, for the PostgreSQL > 17 release. It's just the beginning though, we can only do this for > full table scans so far (plus a couple of other obscure places). > Hopefully in the coming year we'll get the "streaming I/O" mechanism > that powers this hooked up to lots more places... index scans and > other stuff. And writing. Then eventually pushing the I/O into the > background. Your questions actually triggered us to talk about why we > couldn't switch a few things around in our project and get the I/O > combining piece done sooner. Thanks! Better late than never, but I have verified that this makes quite a bit of= =20 difference on Postgres 17, on compressed Btrfs. Sequential scans on=20 transparently compressed tables are now many times faster. Same good=20 experience (if not better) with Postgres 18 and method io_uring. Can't=20 directly compare the two though, since they run on different systems.=20 Thanks! Dimitris --0-786393783-1749816918=:361063--