Re: Does PostgreSQL cache all columns of a table after SELECT? - Mailing list pgsql-novice

From Tim Schwenke
Subject Re: Does PostgreSQL cache all columns of a table after SELECT?
Date
Msg-id 1888bb46d75.c27dbb7f688001.5044215935079224344@trallnag.com
Whole thread Raw
In response to Re: Does PostgreSQL cache all columns of a table after SELECT?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Does PostgreSQL cache all columns of a table after SELECT?  (Tim Schwenke <tim@trallnag.com>)
Re: Does PostgreSQL cache all columns of a table after SELECT?  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-novice
Hello David,

from what I understand, in PostgreSQL, tables are stored in one or more files called segments. There is no separation
bycolumns. 

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
cacheif there is enough space. This means a table with only one large column large_a takes up less page cache compared
toa table with many large columns large_a and large_b, even though in both cases only large_a is selected. 

Is that more or less correct? Ignoring toast?

Tim S.

---- On Mon, 05 Jun 2023 14:58:21 +0200 David G. Johnston  wrote ---

 >
 >
 > On Monday, June 5, 2023, Tim Schwenke tim@trallnag.com> wrote:
 >
 >
 > Does the cache also contain large_b? Or is only large_a cached? Assumption is that memory is large enough to fit
everything.
 >
 >
 > Shared buffers is a page cache.
 >
 > David J. 
 >




pgsql-novice by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Does PostgreSQL cache all columns of a table after SELECT?
Next
From: Tim Schwenke
Date:
Subject: Re: Does PostgreSQL cache all columns of a table after SELECT?