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

From William Alves Da Silva
Subject Re: Does PostgreSQL cache all columns of a table after SELECT?
Date
Msg-id 686C8E94-4B50-40E1-9A5C-6500B47C3622@unochapeco.edu.br
Whole thread Raw
In response to Does PostgreSQL cache all columns of a table after SELECT?  (Tim Schwenke <tim@trallnag.com>)
Responses Re: Does PostgreSQL cache all columns of a table after SELECT?
List pgsql-novice
Hello Tim,

Can you send the EXPLAIN (BUFFERS, ANALYZE, VERBOSE) of your query? This will show you whether the plan is using
cachingor not. 


> On 5 Jun 2023, at 09:15, Tim Schwenke <tim@trallnag.com> wrote:
>
> Hello,
>
> I have the following table with the following columns:
>
> large_a: text (few dozen characters up to a few hundred)
> large_b: text (few dozen characters up to a few hundred)
>
> The table has several million rows. The DB is running on a large machine.
>
> I perform the following query:
>
> select large_a from table;
>
> The first query takes a few minutes. Afterwards I see that the cache in memory has grown. Next query only takes a few
seconds.
>
> What I want to know:
>
> Does the cache also contain large_b? Or is only large_a cached? Assumption is that memory is large enough to fit
everything.
>
>
>

Regards,
William Alves


pgsql-novice by date:

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