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 1q697Y-0005al-Kx for pgsql-novice@arkaria.postgresql.org; Mon, 05 Jun 2023 12:15:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q697W-0005ae-4V for pgsql-novice@arkaria.postgresql.org; Mon, 05 Jun 2023 12:15:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q697V-0005aU-RH for pgsql-novice@lists.postgresql.org; Mon, 05 Jun 2023 12:15:33 +0000 Received: from sender11-op-o11.zoho.eu ([31.186.226.225]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q697O-000L5j-F8 for pgsql-novice@lists.postgresql.org; Mon, 05 Jun 2023 12:15:32 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1685967322; cv=none; d=zohomail.eu; s=zohoarc; b=huW8+V2UNiNLLS6HOVZN3fR81h5lORJIYhAXGi7hfO1D5Ih/lyK0yc4i2x6pRs91w7PesuwXrloU5aAJbsJghsjlIJL75D64BmY4KBjR8g50uJPYVz4Z3y20RAlmRjdNwC+DYmQMCILwpaw5CqVeXnlYlBKqEENRQmPbcokfHgw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1685967322; h=Content-Type:Content-Transfer-Encoding:Date:From:MIME-Version:Message-ID:Subject:To; bh=bicx3UkBF1KqQ//DOsB4iul3kaTo5zfT5FHogTsEmAs=; b=i4IxCgIlqBUiVOH2tqrljLd+l8ZPOlExlKdJcqpqmwyuL2izl1g8nXyeEAhyQ7pfnm3GFmaS2ibot6758MXKYrct5dy5fS/wuXiDkXLg2uguOIEctPZB6WErsl1LDRdIw1n1aPx3RIper2WqAvT5f49S41uGQbLGf0ddqgtPCyE= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=trallnag.com; spf=pass smtp.mailfrom=tim@trallnag.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1685967322; s=zmail; d=trallnag.com; i=tim@trallnag.com; h=Date:Date:From:From:To:To:Message-ID:In-Reply-To:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc; bh=bicx3UkBF1KqQ//DOsB4iul3kaTo5zfT5FHogTsEmAs=; b=CdQEeBdvgpOHWtXOzmc4pCR1QLEUat1zSn1OyXLoZI+0AiRHe5tbP5j2amF6sT2y mNqmMuJf+fTHsgOdMr4giZuV8mXMj6Ek6CUfT9n3K71hiXYGtmdiyvPJasxfZzKslb0 9RKPL9CvlCvjDQevWD16F8V1BPEJCGeDJJy312s4= Received: from mail.zoho.eu by mx.zoho.eu with SMTP id 1685967321092467.98988791178897; Mon, 5 Jun 2023 14:15:21 +0200 (CEST) Date: Mon, 05 Jun 2023 14:15:21 +0200 From: Tim Schwenke To: "pgsql-novice" Message-ID: <1888b7bb7fa.112313046679561.2788161417267896332@trallnag.com> In-Reply-To: Subject: Does PostgreSQL cache all columns of a table after SELECT? MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.