Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tuemk-00AUhf-KE for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Mar 2025 21:47:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tuemX-006BcC-JS for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Mar 2025 21:47:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tuemX-006BbH-9C for pgsql-hackers@lists.postgresql.org; Tue, 18 Mar 2025 21:47:29 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tuemV-003a1w-0b for pgsql-hackers@lists.postgresql.org; Tue, 18 Mar 2025 21:47:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 52ILlNvb586813; Tue, 18 Mar 2025 17:47:23 -0400 From: Tom Lane To: Bruce Momjian cc: Andres Freund , Melanie Plageman , PostgreSQL-development , Greg Smith Subject: Re: Increase default maintenance_io_concurrency to 16 In-reply-to: References: <4p7gtb2nfr3njhgq7bmpe24unsbyoerlom7zrcu5sl2vyyutlp@ol5ywrm7j5ok> Comments: In-reply-to Bruce Momjian message dated "Tue, 18 Mar 2025 17:19:41 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <586811.1742334443.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 18 Mar 2025 17:47:23 -0400 Message-ID: <586812.1742334443@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bruce Momjian writes: >>> https://www.postgresql.org/docs/current/runtime-config-query.html#RUNT= IME-CONFIG-QUERY-CONSTANTS >>> = >>> Random access to mechanical disk storage is normally much more expensi= ve >>> than four times sequential access. However, a lower default is used >>> (4.0) because the majority of random accesses to disk, such as indexed >>> reads, are assumed to be in cache. The default value can be thought of >>> as modeling random access as 40 times slower than sequential, while >>> expecting 90% of random reads to be cached. This explanation is, in fact, made up out of whole cloth. It has diddly-squat to do with where the number came from, although maybe it's an okay rationalization for continuing to use 4.0 on modern hardware. Where the number came from is that I did a bunch of testing back in the late 90s and random_page_cost =3D 4.0 made the planner's ratios of seqscan vs indexscan costs match up with observed timings. Of course, those observations were made with spinning-rust drives, so you'd not get the same results on SSDs. > Yes, I can't say there is much research behind the value, and even if > there was, the assumed hardware is unlikely to be relevant today. Yes as to the latter, no as to the former. regards, tom lane