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 1u8RoM-004FEt-8g for pgsql-general@arkaria.postgresql.org; Fri, 25 Apr 2025 22:46:22 +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 1u8RoK-00G5sk-3r for pgsql-general@arkaria.postgresql.org; Fri, 25 Apr 2025 22:46:20 +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 1u8RoJ-00G5sa-NX for pgsql-general@lists.postgresql.org; Fri, 25 Apr 2025 22:46:20 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u8RoI-001xse-0Y for pgsql-general@lists.postgresql.org; Fri, 25 Apr 2025 22:46:19 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-39c1ee0fd43so2208628f8f.0 for ; Fri, 25 Apr 2025 15:46:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1745621177; x=1746225977; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=IpB3VsUZDvEXLGrHqII39Qtn2rwesK5/2x8ewGaOdho=; b=gI0WPbvvYy3bMm5LGYJRawWo+LyMm+Hfc/0pG8POUH2inxbBWUh3gEJyLlycF1qF4v 7K8/Mcf+1oPbBjXdL29kLHPM7oykLThlL1wkJayzcmBDoH5pnWJizZIkVzrNu+m3PvaG MGJVKqQiG/phGr0z3SFmeu1kAe81+PHW0MPW2zxpKq7r8JacFXO6Hhzd1Ungiy97nwf0 T9GF0rub3As2K187+2lq+A7Ti88/R+8kpnbDC/vSldiWPMLGgEDPuZ+BYflJaDpmVkFx Cs3rjyynyLCAJvyEBXUWwGrOrtekmp3PJUj6pRQB7H8jqgLA18E3DoI+G0Frh9JCk1Bo qTeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745621177; x=1746225977; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=IpB3VsUZDvEXLGrHqII39Qtn2rwesK5/2x8ewGaOdho=; b=htV2FmveBaBS02RJ0vrK1PRM8EqQfir6PH8yXkz9HGSqkzLkA50Eb82WGz2IGyi7Iz z2FpH88mW6kzFsSfcLGgL+IBDwIJww2A/2s02kwDf5X0JbS2A46LmP3ktn3IU7KSatAj GbFMOrraoiJ9gCblm3218tDdGmoQbmipTTBiGj5FfV3oi0uQpkUUWqEmXvf6SdzqcSvs dIOycMVSqQaqIvOMm62IiWVYAWHP9SrRUoWULalDwsAEPdj9lxAxBLzT05NAvYPXNtQQ fcv/Wn75nODB8UPtNqa28AMAZP1Va4zD9tL8a/nKETB+UgPuxv39xuIUV7B6llMMyHtY jmRA== X-Forwarded-Encrypted: i=1; AJvYcCXjgXi0kvyW4lNrbsdMfOJL1i9TltVfyr4Jxl/xDA0zGEgSxrA1esNMKa6/lNZWDUwgCXKhABcSvpFhCMPp@lists.postgresql.org X-Gm-Message-State: AOJu0YwZ+pytVOtGyXV3crTo9pWAPMFitepKvuGmkJ7+0+qFl93K0EQq Kxk4kJ901MInUhFbOjTmDmNbHS1psQ52SH5sJwtoXMx6LyjTGrSoOc+7jhpVRK4= X-Gm-Gg: ASbGncv6GxzGkTceyLU+8Az5esjDTp+3ZVItV+Cu/93TAs1e0FQboYmXi/VIQxPwnRb mS0dygGwMabYSQ3FSsCjHdeE9muzU9HIMRzQfjgCLr0N4vxUuw52TCPnlMNBKyTC3nU34/RqfTE sK4Hq1cBnAT+i4hTQbw9ixKWNOUzKpirl7yvml4XLW5ZVYv9yUq/gip2gPzLPI4rGhzqgsjkTmY syZcraV20tcD0QRfURXabTppVphIWQDxwalUFKksNs10S4KLSEs7YhNMFUKaKRrijwY1rN4tOgV TkFrD8aCH6dO0s+aaPJbTCo80Cgo+kNiUMgkmYrd/auX2O43dMFFe5PfuM1U X-Google-Smtp-Source: AGHT+IFsuX+5D93EaSqt5kcjae+4id/eLNeVMwYVehmBR4brOEsrx4ou3AVRf15EyC4BwiDE91L12g== X-Received: by 2002:a05:6000:1971:b0:390:de33:b0ef with SMTP id ffacd0b85a97d-3a07aa6fdbcmr445332f8f.30.1745621176509; Fri, 25 Apr 2025 15:46:16 -0700 (PDT) Received: from localhost.localdomain ([2001:871:260:129:a3fa:8630:2f71:3226]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a073e4684csm3540428f8f.76.2025.04.25.15.46.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Apr 2025 15:46:16 -0700 (PDT) Message-ID: <8b2525bcc0c714603cc4f44a686b8b0e4659ac92.camel@cybertec.at> Subject: Re: shared buffers From: Laurenz Albe To: Marc Millas , "pgsql-general@lists.postgresql.org" Date: Sat, 26 Apr 2025 00:46:15 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 >=20 > on pg13, if I run a big request with explain (analyze,buffers),=C2=A0 > I see around 6 GB read > if I do rerun the very same request, no more read(s), all data in the sha= red buffers cache. fine > If I check with pg_buffercache what's in it, I see the biggest tables of = my request within > the biggest users (in number of blocks used). All this is fine. >=20 > next, if I do the very same on the pg16 machine, whatever the number of t= imes I rerun the > explain=C2=A0(analyze, buffers) of the same request, each time, the expla= in 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 in= stead of blowing out more than a quarter of its buffer cache. Yours, Laurenz Albe