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 1p2aUA-00072t-Gr for pgsql-admin@arkaria.postgresql.org; Tue, 06 Dec 2022 16:07:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p2aU9-00046l-Co for pgsql-admin@arkaria.postgresql.org; Tue, 06 Dec 2022 16:07:57 +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 1p2aU8-00046c-UB for pgsql-admin@lists.postgresql.org; Tue, 06 Dec 2022 16:07:56 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2aU6-0007SO-66 for pgsql-admin@lists.postgresql.org; Tue, 06 Dec 2022 16:07:55 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 96F28671F3; Tue, 6 Dec 2022 16:07:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo07-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo07-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id agWeeEEQkQZs; Tue, 6 Dec 2022 16:07:52 +0000 (UTC) Received: from smtpclient.apple (mobile-166-175-59-19.mycingular.net [166.175.59.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 03FB6671F7; Tue, 6 Dec 2022 16:07:51 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Subject: Re: need suggestion on querying big tables From: Scott Ribe In-Reply-To: Date: Tue, 6 Dec 2022 10:07:41 -0600 Cc: pgsql-admin@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Ron X-Mailer: Apple Mail (2.3731.200.110.1.12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Dec 6, 2022, at 8:51 AM, Ron wrote: >=20 > https://www.postgresql.org/docs/11/runtime-config-query.html >=20 > effective_cache_size is how much RAM a single query gets. "When = setting this parameter you should consider both PostgreSQL's shared = buffers". >=20 > https://www.postgresql.org/docs/11/runtime-config-resource.html >=20 > "a reasonable starting value for shared_buffers is 25% of the memory = in your system. There are some workloads where even larger settings for = shared_buffers are effective, but because PostgreSQL also relies on the = operating system cache, it is unlikely that an allocation of more than = 40% of RAM to shared_buffers will work better than a smaller amount." >=20 > You've set effective_cache_size to 83%, when it should be at most 20%. effective_cache_size is a hint as to how much RAM is available for the = operating system file cache after all other uses are taken into account.=