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 1jT6R0-0006Yw-O0 for pgsql-docs@arkaria.postgresql.org; Mon, 27 Apr 2020 16:16:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jT6Qz-0008A5-CW for pgsql-docs@arkaria.postgresql.org; Mon, 27 Apr 2020 16:16:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jT6Qz-00089Y-6j for pgsql-docs@lists.postgresql.org; Mon, 27 Apr 2020 16:16:41 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jT6Qs-00089I-Ew for pgsql-docs@lists.postgresql.org; Mon, 27 Apr 2020 16:16:40 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1jT6Qo-0008UT-Ol; Mon, 27 Apr 2020 12:16:30 -0400 Date: Mon, 27 Apr 2020 12:16:30 -0400 From: Bruce Momjian To: Pavel Stehule Cc: yigong hu , splarv@ya.ru, pgsql-docs@lists.postgresql.org Subject: Re: explanation for random_page_cost is outdated Message-ID: <20200427161630.GB21731@momjian.us> References: <20200319205646.GB28431@momjian.us> <72492300-BFD4-4CCF-9136-20CC41A18A10@ya.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="mP3DRpeJDSE+ciuQ" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Mon, Apr 27, 2020 at 06:02:41AM +0200, Pavel Stehule wrote: > > > ne 26. 4. 2020 v 21:25 odesílatel yigong hu napsal: > > Sorry to hijack the thread, I also recently have similar observation that > the statement about random_page_cost on SSD is ambiguous. The current > document says that > > > Storage that has a low random read cost relative to sequential, e.g. > solid-state drives, might also be better modeled with a lower value for > random_page_cost. > > However, this statement does not clarify what values might be good. For > some workload, the default value 4.0 would cause bad performance and > lowering random_page_cost to a value 3.0 or 2.0 does not solve the > performance problem. Only when the random_page_cost is lowered to below 1.2 > will the bad performance be mitigated. Thus, I would suggest elaborating on > this description further as: > >  >  Storage that has a low random read cost relative to sequential, e.g. > solid-state drives, might also be better modeled with a value that is close > to 1 for random_page_cost. > > > I depends on estimation. Lot of people use random_page_cost as fix of broken > estimation. Then configures this value to some strange values. Lot of other > queries with good estimation can be worse then. I have been recommending 1.1 as a value for random_page_cost for SSDs for years, and I think it would be helpful to suggest that value, so doc patch attached. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + --mP3DRpeJDSE+ciuQ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="random.diff" diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml new file mode 100644 index a14df06..38ae273 *** a/doc/src/sgml/config.sgml --- b/doc/src/sgml/config.sgml *************** ANY num_s *** 4915,4921 **** the database is smaller than the total server memory, decreasing random_page_cost can be appropriate. Storage that has a low random read cost relative to sequential, e.g. solid-state drives, might ! also be better modeled with a lower value for random_page_cost. --- 4915,4922 ---- the database is smaller than the total server memory, decreasing random_page_cost can be appropriate. Storage that has a low random read cost relative to sequential, e.g. solid-state drives, might ! also be better modeled with a lower value for random_page_cost, ! e.g., 1.1. --mP3DRpeJDSE+ciuQ--