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 1suBdU-004sOf-0R for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2024 14:07:56 +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 1suBdT-009s3Z-71 for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2024 14:07:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1suBdS-009s2z-Tp for pgsql-hackers@lists.postgresql.org; Fri, 27 Sep 2024 14:07:54 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1suBdP-001Mnm-95 for pgsql-hackers@postgresql.org; Fri, 27 Sep 2024 14:07:54 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2f75d044201so21793711fa.0 for ; Fri, 27 Sep 2024 07:07:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727446072; x=1728050872; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=8w30qHzFhQxEDb3+Ci0NKMiF85g3j1ob444N9OTdzqI=; b=S6Y23mYtgrt3LFf0I0zFviaD99C8mYOiGDIUByNdGL7rv/6Nv2/LvefoUmgJXZLTJW sXkAU4+8T9K5U1NiKaXgpn7TeKLbAWe/8lKFhyv1wEF86O7U3ctCd1eeDKwIBWdcrhev rGIzcqwcD98eMZrhJ8r7aF4Gxg1kMaD0FpQJkLw6IbVVk5nMgLtYMIzq7OIiXCiGF130 CP86i+hQgPczJuUNaVh3HSMkuvQXHGrdXdeDZbe1T4qSbeOJ85pyUeLcVVDX78IipKw1 VtoYyc/E6gnJ4uyDepXEK3zZlpDcuK+s3PmA4TGrzzQnjT7t+ew2ZJM26P/D1Lq41iid BxsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727446072; x=1728050872; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8w30qHzFhQxEDb3+Ci0NKMiF85g3j1ob444N9OTdzqI=; b=ofSKcI6lxwtmiOmqhAPnOnq+NUhWWcBceYNWU9U7Smyodcfn1ibv/q90hFzkBWkxOY ffkvGAUMqPZ5drxuvopo2O3gVsYZf/gDTKTkxud60ObWEtcDujvzqJ3BPJO3SZ34mugH g/qR+VIA4bBb9TJd8HAGFN0CE8pe0VErOwenMDVB6Tk59yloWvTvb9Q39HnH+eftw39k jtSOhSUyk9PrIGiJh5T/sSUScyhHOqjakT5qgpBswxvOaadGYKyFZ8AH5aWmgv9R6+lD 4DN+09EebAD9e87Mi5805VuJN+mcy/0CSmY5vmF2ZlJH9Z9u1A2/BW024xElKdI0sdpT QGFQ== X-Gm-Message-State: AOJu0YwKxQ00xc8zVY+qGnOjgdz+Ne5+CzkXSZIfq6yEf5BlxW4DgYUz AqtxCeRUNwQElYK+APNm22dX9nQH0b4CM6wdC0MQGS9MxyIFWVVrsl0DOUntAymN2dETayC7Hrr HVweofT6BFOThAQSp+ZpMiSzLdFiFhg== X-Google-Smtp-Source: AGHT+IF9aRi2MaLuJ7B4FiaUAFMpXjmcndMJS1iOehSQwwPa0obfq+IWDnNsUBQh8q2R6DyM+pV6JkAFa8N2YvG6JkQ= X-Received: by 2002:a05:651c:1502:b0:2f5:2ba:2c89 with SMTP id 38308e7fff4ca-2f9d3358700mr15642651fa.11.1727446071214; Fri, 27 Sep 2024 07:07:51 -0700 (PDT) MIME-Version: 1.0 From: Greg Sabino Mullane Date: Fri, 27 Sep 2024 10:07:14 -0400 Message-ID: Subject: Changing the default random_page_cost value To: pgsql-hackers Content-Type: multipart/alternative; boundary="000000000000718bd006231a6116" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000718bd006231a6116 Content-Type: text/plain; charset="UTF-8" tl;dr let's assume SSDs are popular and HDDs are the exception and flip our default As I write this email, it's the year 2024. I think it is time we lower our "default" setting of random_page_cost (as set in postgresql.conf.sample and the docs). Even a decade ago, the current default of 4 was considered fairly conservative and often lowered. The git logs shows that this value was last touched in 2006, during the age of spinning metal. We are now in a new era, the age of SSDs, and thus we should lower this default value to reflect the fact that the vast majority of people using Postgres these days are doing so on solid state drives. We tend to stay ultra-conservative in all of our settings, but we also need to recognize when there has been a major shift in the underlying hardware - and calculations that our defaults are based on. Granted, there are other factors involved, and yes, perhaps we should tweak some of the similar settings as well, but ranom_page_cost is the one setting most out of sync with today's hardware realities. So I'll be brave and throw a number out there: 1.2. And change our docs to say wordage like "if you are using an older hard disk drive technology, you may want to try raising rpc" to replace our fairly-hidden note about SSDs buried in the last sentence - of the fourth paragraph - of the rpc docs. Real data about performance on today's SSDs are welcome, and/or some way to generate a more accurate default. Cheers, Greg --000000000000718bd006231a6116 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
tl;dr let's assume SSDs are popular and HDDs are = the exception and flip our default

A= s I write this email, it's the year 2024. I think it is time we lower o= ur "default" setting of random_page_cost (as set in postgresql.co= nf.sample and the docs). Even a decade ago, the current default of 4 was co= nsidered fairly conservative and often lowered. The git logs shows that thi= s value was last touched in 2006, during the age of spinning=C2=A0metal. We= are now in a new era, the age of SSDs, and thus we should lower this defau= lt value to reflect the fact that the vast majority of people using Postgre= s these days are doing so on solid state drives. We tend to stay ultra-cons= ervative in all of our settings, but we also need to recognize when there h= as been a major shift in the underlying hardware - and calculations that ou= r defaults are based on.

Granted, there are other = factors involved, and yes, perhaps we should tweak some of the similar sett= ings as well, but ranom_page_cost is the one setting most out of sync with = today's hardware realities. So I'll be brave and throw a number out= there: 1.2. And change our docs to say wordage like "if you are using= an older hard disk drive technology, you may want to try raising rpc"= to replace our fairly-hidden note about SSDs buried in the last sentence -= of the fourth paragraph - of the rpc docs.

Real d= ata about performance on today's SSDs are welcome, and/or some way to g= enerate a more accurate default.

Cheers,
Greg

--000000000000718bd006231a6116--