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 1kWlVH-0002hU-PR for pgsql-docs@arkaria.postgresql.org; Sun, 25 Oct 2020 19:16:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kWlVF-0003NT-22 for pgsql-docs@arkaria.postgresql.org; Sun, 25 Oct 2020 19:16:29 +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 1kWlVE-0003NG-8x for pgsql-docs@lists.postgresql.org; Sun, 25 Oct 2020 19:16:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kWlV6-00059Y-QE for pgsql-docs@lists.postgresql.org; Sun, 25 Oct 2020 19:16:26 +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 09PJGD6r572474; Sun, 25 Oct 2020 15:16:15 -0400 From: Tom Lane To: github@jurr.org cc: pgsql-docs@lists.postgresql.org Subject: Re: Chapter 14.1.1, small typo on costs? In-reply-to: <160362404830.24751.12549386489720350845@wrigleys.postgresql.org> References: <160362404830.24751.12549386489720350845@wrigleys.postgresql.org> Comments: In-reply-to PG Doc comments form message dated "Sun, 25 Oct 2020 11:07:28 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <572472.1603653373.1@sss.pgh.pa.us> Date: Sun, 25 Oct 2020 15:16:13 -0400 Message-ID: <572473.1603653373@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Doc comments form writes: > I am reading 14.1.1 and at the very end (just before 14.1.2) I see: > "which shows that the planner thinks that sorting onek by index-scanning is > about 12% more expensive than sequential-scan-and-sort." > I feel that 12% is incorrect, but I'm not quite sure. The costs are 268.19 > and 292.65, and that's about 9% more expensive? No, the comparison this has in mind is 224.79 (the indexscan on onek in the last plan) versus 200.33 (the sort on onek in the previous plan). So 12% is about right. regards, tom lane