Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q6BAE-0002cb-AM for pgsql-novice@arkaria.postgresql.org; Mon, 05 Jun 2023 14:26:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q6BAD-0006RC-3u for pgsql-novice@arkaria.postgresql.org; Mon, 05 Jun 2023 14:26:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q6BAC-0006R3-RJ for pgsql-novice@lists.postgresql.org; Mon, 05 Jun 2023 14:26:28 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q6BA5-000OD9-6d for pgsql-novice@lists.postgresql.org; Mon, 05 Jun 2023 14:26:28 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4f3bb61f860so6276637e87.3 for ; Mon, 05 Jun 2023 07:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685975179; x=1688567179; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PAQdgm35ZEf6nMdHBsz8kHneuW1sRjwDqg5OZiEn90I=; b=Kvd1XzVnh6yCTWSUzmJzZ9S91tIROkbcBsszgK235qCdUJcTYi8Zrik7iSQXdufvc4 y+KGn6OgpDFELJu53oQVnFb/wO/6rX7yI34c4bINGGTQtojdfQ89YCFNye+dsgRuuNme goF52tfidZOkxgsnorz5HC7vp/ey0ETOF2Uua2jOVCo71rF3ak3k1oXa+wJDpqe203eU 0ZmnT+iwK4wMnh4aLUaT/LMjL1TMqcpw0VmGLFbQiDFlG09VVhbfq7NKGeAQiKGM+sH5 ipplldGQrM/mlkOqNlURKng68Z9R/HI/rfYaWTp+P/OyaravutYVki5TC2hvOBfBXyIo 7B8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685975179; x=1688567179; 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=PAQdgm35ZEf6nMdHBsz8kHneuW1sRjwDqg5OZiEn90I=; b=MnDy5cw/DKfGNOs/yr8nA0+Q3ZyGeqRLSz2q4DKruGfBv0+/U4QhbFpkGHl2tCA9uO ouvJIKxDO26ExSd7zqTHElNqDS7sFNwM3BxYcV2q9MPWFxzvIHXEd+hPIEhY1k1jcm/T J5yiOgzrgrfxvj/XdSf7KY5E6nwgstJwNFEl53jrdB5hrm5uQe7pYL75pbRfitpPuQk8 +bG8gO2yzTWwbYOASu7EGlq7xfLnJv1T8KlT+tJpaERLhaOzD5OxNTjZ2/5jmm2X5gEB ZMAUcYD/oZZg1dLw9A5f0/bNXB0WVElzQKidRhJlhlfDY1IpbLBCIrKbPJBEhGPKHSV7 q2Aw== X-Gm-Message-State: AC+VfDxVTiVeQfUqGDrs0LeddTVf+1B1pmrSa9iFkKFpLfXkIUaxIo2X sEvG+HS00I3XIDYA1t3pOTahHgy+F5/a4nOZLK8= X-Google-Smtp-Source: ACHHUZ5f4L3tGpVW3AHuTA3EcpUyeAc3KntmeWnZVvZgLZS6ZjLyjkJiVQnVGsssR3K+qE/u1TZgr1XucWjjzBnCNG4= X-Received: by 2002:ac2:5143:0:b0:4f4:c973:c97d with SMTP id q3-20020ac25143000000b004f4c973c97dmr5075477lfd.25.1685975179113; Mon, 05 Jun 2023 07:26:19 -0700 (PDT) MIME-Version: 1.0 References: <1888b7bb7fa.112313046679561.2788161417267896332@trallnag.com> <1888bb46d75.c27dbb7f688001.5044215935079224344@trallnag.com> In-Reply-To: <1888bb46d75.c27dbb7f688001.5044215935079224344@trallnag.com> From: "David G. Johnston" Date: Mon, 5 Jun 2023 07:26:08 -0700 Message-ID: Subject: Re: Does PostgreSQL cache all columns of a table after SELECT? To: Tim Schwenke Cc: Pgsql Novice Content-Type: multipart/alternative; boundary="000000000000a6bb7a05fd62afe2" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a6bb7a05fd62afe2 Content-Type: text/plain; charset="UTF-8" On Mon, Jun 5, 2023, 06:17 Tim Schwenke wrote: > Hello David, > > from what I understand, in PostgreSQL, tables are stored in one or more > files called segments. There is no separation by columns. > > https://www.postgresql.org/docs/8.1/storage.html > > This means if I select a single column from a table the first time, the > full file / segment is read and put into page cache if there is enough > space. Pages are subsegment. You may also wish to take care to notice the version of documentation pages you look at and reference. 8.1 is long past its expiration date. David J. --000000000000a6bb7a05fd62afe2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Jun 5, 2023, 06:17 Tim Schwenke <tim@trallnag.com> wrote:
Hello David,

from what I understand, in PostgreSQL, tables are stored in one or more fil= es called segments. There is no separation by columns.

https://www.postgresql.org/docs/8.1/stora= ge.html

This means if I select a single column from a table the first time, the ful= l file / segment is read and put into page cache if there is enough space.<= /blockquote>

Pages= are subsegment.

You may= also wish to take care to notice the version of documentation pages you lo= ok at and reference.=C2=A0 8.1 is long past its expiration date.

David J.
--000000000000a6bb7a05fd62afe2--