Does PostgreSQL cache all columns of a table after SELECT?

From: Tim Schwenke <tim(at)trallnag(dot)com>
To: "pgsql-novice" <pgsql-novice(at)lists(dot)postgresql(dot)org>
Subject: Does PostgreSQL cache all columns of a table after SELECT?
Date: 2023-06-05 12:15:21
Message-ID: 1888b7bb7fa.112313046679561.2788161417267896332@trallnag.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message William Alves Da Silva 2023-06-05 12:19:53 Re: Does PostgreSQL cache all columns of a table after SELECT?
Previous Message sudham saka 2023-06-02 21:10:41 Re: Training courses on PostgreSQL