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 1u9MKR-000ugl-Jf for pgsql-general@arkaria.postgresql.org; Mon, 28 Apr 2025 11:07:16 +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 1u9MJR-000EJ9-AO for pgsql-general@arkaria.postgresql.org; Mon, 28 Apr 2025 11:06:14 +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 1u9MJQ-000EJ0-Rl for pgsql-general@lists.postgresql.org; Mon, 28 Apr 2025 11:06:14 +0000 Received: from mail-vk1-xa33.google.com ([2607:f8b0:4864:20::a33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u9MJO-002PYs-1t for pgsql-general@lists.postgresql.org; Mon, 28 Apr 2025 11:06:12 +0000 Received: by mail-vk1-xa33.google.com with SMTP id 71dfb90a1353d-5259327a937so1845669e0c.0 for ; Mon, 28 Apr 2025 04:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mokadb-com.20230601.gappssmtp.com; s=20230601; t=1745838370; x=1746443170; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PqUxG40Yix15JHAV/XtJvfHnUBpr/b6dLkrA+JSX9hI=; b=i99iCFViCiTRLuOJyKK9KX3Q/bghc7Z2Id0OfmV3SS60w+7k3yiuZzGCZx50MMdWyK I2hzvlWG5pWp7bhoBumv23rIKofIrI+CQ7jd1oUDl9mVyEHWROluU/lnJO8WtesH7/gE iPrjB4J1NNW1SN1/Fz4ikRW9UBz3TowGlycfFRJgUSCIIeU893S8jho8JwvtZvaiQCae DSreV22gYJr4mzuZfWXNIX+LasH9624jbKJvFz1IANqy8SB3dhUoWDGNACnXoYRvoJW2 x0Dh6bwCdhtEXLsvHC/9DNCwmc0uYro6PneV5c1s16zOvSy40yB7MpKI7iNHd4aNcNLy OGuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745838370; x=1746443170; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PqUxG40Yix15JHAV/XtJvfHnUBpr/b6dLkrA+JSX9hI=; b=gclySyw2xL7hlbP0pOqcYis+s8MDEPl+c0qvcf0USr7U1F/zJkE/M0rFM3wnoEEqFw BHKGMwPuKZhmCang5O22G1ULNHbmvLEo4PxeRfQNEAIhiKhKCMTmOha2OFUDvOCtx+Wn VCJwrXxQI7Bej3ocZqZ3rGCIs4xSfN6UbpOxUH/gUR2dOpAnfK8N9ZSTdaSthMq1FumC hk8vlQkaOsjwbwzp/ieGv9SHJuwhxetBjF1qrWZtukABTZ4qiE0UG1Yt0/b8s2c/E0tW QrJBzAq2zRQUfmjblN5k6OiVjPRvRoY979jThIFcGFsYl+5pXlG6IOcyTjNkSkqNxx5d Lgnw== X-Gm-Message-State: AOJu0Yx08tM6QZHLyEeL6MVAKcCidtQyORw+qXDBT3Vj8v6jfkhfE0s1 EGcRk9piJOXvbB8UOBzbo0kq15RFXw3jPJHxjv3W5H3qs21LIJLRua5RMpd+lMtOen/B/XysPGw dylxU+tXJ/Fgfqj9wb2yxiieF+nYEOs37ndFSrnuQgVJGlgzq X-Gm-Gg: ASbGncsKLmGTKURh0TBSuVkLniM/EdXaYfS1X1vZXxPWT6MCZ5Mcz1N4e7s9/82QGB3 W3IwArnR9HyV4GDD1ln63W6T18sAY6GnPTVnj7q6Q1O1y5nzeqQ2hS4h/5fzG26f4AT32gbyPm5 7lPOFtYpUri44bjaQreAdi8Q== X-Google-Smtp-Source: AGHT+IGjnoyyGoGIQp6pV08QdpLHgEkxo4I155tkNAQIypj3sEKzrNjIUTEO1lCZWaHRefVj1ldk3lag+E+ioFmCRd8= X-Received: by 2002:a05:6122:1d4d:b0:52a:791f:7e20 with SMTP id 71dfb90a1353d-52a89d9407cmr7061980e0c.4.1745838370039; Mon, 28 Apr 2025 04:06:10 -0700 (PDT) MIME-Version: 1.0 References: <8b2525bcc0c714603cc4f44a686b8b0e4659ac92.camel@cybertec.at> In-Reply-To: <8b2525bcc0c714603cc4f44a686b8b0e4659ac92.camel@cybertec.at> From: Marc Millas Date: Mon, 28 Apr 2025 13:05:59 +0200 X-Gm-Features: ATxdqUHxnPEGDEqjaIxIHK0jyqQdOzkUgEjp4z6n_g-E9IJYdHdd-VpF9jTAStA Message-ID: Subject: Re: shared buffers To: Laurenz Albe Cc: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="000000000000e1cfef0633d4ab4a" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000e1cfef0633d4ab4a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I didnt know this. thanks, Marc MILLAS Senior Architect +33607850334 www.mokadb.com On Sat, Apr 26, 2025 at 12:46=E2=80=AFAM Laurenz Albe wrote: > On Fri, 2025-04-25 at 15:42 +0200, Marc Millas wrote: > > got something strange to me: > > Same db ie. same data, around 1.2TB,one on pg13, one on pg16 > > same 16 GB of shared_buffers, > > I am the single user. > > both have track_io_timing on > > > > on pg13, if I run a big request with explain (analyze,buffers), > > I see around 6 GB read > > if I do rerun the very same request, no more read(s), all data in the > shared buffers cache. fine > > If I check with pg_buffercache what's in it, I see the biggest tables o= f > my request within > > the biggest users (in number of blocks used). All this is fine. > > > > next, if I do the very same on the pg16 machine, whatever the number of > times I rerun the > > explain (analyze, buffers) of the same request, each time, the explain > shows the same volume > > of reads. again and again. > > If I check with pg_buffercache, the set of objects stay the same, > WITHOUT the objects of my > > request, just like if those objects where sticky. > > I can't see the plans, so I can only guess. > > Perhaps the v16 plan uses a sequential scan on a table that is more than = a > quarter of > shared_buffers in size, so that PostgreSQL uses a ring buffer to read it > instead of > blowing out more than a quarter of its buffer cache. > > Yours, > Laurenz Albe > --000000000000e1cfef0633d4ab4a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I didnt=C2=A0know this.
thanks,
<= br>
Marc MILLAS
Sen= ior Architect
+33607850334

=


On Sat, Apr 26, 2025 at 12:46= =E2=80=AFAM Laurenz Albe <la= urenz.albe@cybertec.at> wrote:
On Fri, 2025-04-25 at 15:42 +0200, Marc Millas wrote:=
> got something strange to me:
> Same db ie. same data, around 1.2TB,one on pg13, one on pg16
> same 16 GB of shared_buffers,
> I am the single user.
> both have track_io_timing on
>
> on pg13, if I run a big request with explain (analyze,buffers),=C2=A0<= br> > I see around 6 GB read
> if I do rerun the very same request, no more read(s), all data in the = shared buffers cache. fine
> If I check with pg_buffercache what's in it, I see the biggest tab= les of my request within
> the biggest users (in number of blocks used). All this is fine.
>
> next, if I do the very same on the pg16 machine, whatever the number o= f times I rerun the
> explain=C2=A0(analyze, buffers) of the same request, each time, the ex= plain shows the same volume
> of reads. again and again.
> If I check with pg_buffercache, the set of objects stay the same, WITH= OUT the objects of my
> request, just like if those objects where sticky.

I can't see the plans, so I can only guess.

Perhaps the v16 plan uses a sequential scan on a table that is more than a = quarter of
shared_buffers in size, so that PostgreSQL uses a ring buffer to read it in= stead of
blowing out more than a quarter of its buffer cache.

Yours,
Laurenz Albe
--000000000000e1cfef0633d4ab4a--