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 1p2V5c-0002bI-EE for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Dec 2022 10:22:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p2V5a-0004dm-6F for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Dec 2022 10:22:14 +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 1p2V5Z-0004dd-NN for pgsql-hackers@lists.postgresql.org; Tue, 06 Dec 2022 10:22:13 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p2V5X-0004PB-2f for pgsql-hackers@lists.postgresql.org; Tue, 06 Dec 2022 10:22:12 +0000 Received: by mail-wr1-x433.google.com with SMTP id h11so22717828wrw.13 for ; Tue, 06 Dec 2022 02:22:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aiven.io; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MWTPSKWy9fuOuFDvDD/W3Yr9idGPx4/cH/Sa3tllcI4=; b=SwDBYPmenZSkB6EPy7UsPX6eqGdNl16Oxrxnuoao6bvreMXwR+veVIIPE3Zcw1Q6zp mM+DNZnQQEsVuIQslY6Fvmqu7U47v9jNk5EV2iJqJ2AZDOzv5TEWORAGewG9D2xOMoEp G2DLYIVOZTgI32j4Z2rM441qk31zxLd4Tns/k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MWTPSKWy9fuOuFDvDD/W3Yr9idGPx4/cH/Sa3tllcI4=; b=JcE1OJS9hnhb3tiaxozIHBzO6QIPcAXmfd+A4kdjYIKGt+xEUpQBiS/QJKXV8yFWoX ijpe5RtzcG3nisDmWRH/AdJPHaHeVPJD8b2N8K4iBObZ7bz6966rhNJBYmvOJRwM7Hhm C2UwSbXzuo1eZ472JQzw9lFSqInlwEW1JIABdFWUo+UmsCFHQwWaKcZ52JvzthKPHql6 kV1fdTr4t+eo6dzHaLI3h0+LhiK86Ze/PXZW5lGydWnZVcL9UhkDj1vo61k2Ok425u0k pVzTFCxz7hmNPYKNdZNOJX85zT/jv1ZjTJspIDYBfGH9NeWYrQb9EjNRdgG4Hgnl7i8L KP+Q== X-Gm-Message-State: ANoB5pnffH1Kz6fVy/ZgDNPUdFJ7FfjC6gKKvKfaXo6hgrQ/xFprkQlT 1/IxI9RgCaBL5gLk6egCWPU1UA== X-Google-Smtp-Source: AA0mqf6PxmRX93j5aScdaYFJCr9Am7Phh7dBGfQF2tLT5NV+oyIrRPTB5dlurqLZacgTYnfBpSDsbw== X-Received: by 2002:adf:e6c8:0:b0:242:18c4:694e with SMTP id y8-20020adfe6c8000000b0024218c4694emr23715651wrm.175.1670322128908; Tue, 06 Dec 2022 02:22:08 -0800 (PST) Received: from aivenlaptop.localnet ([45.13.105.93]) by smtp.gmail.com with ESMTPSA id n5-20020adff085000000b00236c1f2cecesm19999057wro.81.2022.12.06.02.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Dec 2022 02:22:08 -0800 (PST) From: Ronan Dunklau To: Alexander Korotkov , pgsql-hackers@lists.postgresql.org Cc: Tom Lane , Michael Paquier , pgsql-hackers@lists.postgresql.org Subject: Re: Fix gin index cost estimation Date: Tue, 06 Dec 2022 11:22:20 +0100 Message-ID: <4787929.31r3eYUQgx@aivenlaptop> In-Reply-To: <10184681.nUPlyArG6x@aivenlaptop> References: <3188617.44csPzL39Z@aivenronan> <10184681.nUPlyArG6x@aivenlaptop> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart4444252.LvFx2qVVIh" Content-Transfer-Encoding: 7Bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --nextPart4444252.LvFx2qVVIh Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Le vendredi 2 d=C3=A9cembre 2022, 13:58:27 CET Ronan Dunklau a =C3=A9crit : > Le vendredi 2 d=C3=A9cembre 2022, 12:33:33 CET Alexander Korotkov a =C3= =A9crit : > > Hi, Ronan! > > Thank you for your patch. Couple of quick questions. > > 1) What magic number 50.0 stands for? I think we at least should make > > it a macro. >=20 > This is what is used in other tree-descending estimation functions, so I > used that too. Maybe a DEFAULT_PAGE_CPU_COST macro would work for both ? = If > so I'll separate this into two patches, one introducing the macro for the > other estimation functions, and this patch for gin. The 0001 patch does this. >=20 > > 2) "We only charge one data page for the startup cost" =E2=80=93 should= this > > be dependent on number of search entries? In fact there was another problem. The current code estimate two different= =20 pathes for fetching data pages: in the case of a partial match, it takes in= to=20 account that all the data pages will have to be fetched. So this is is now= =20 taken into account for the CPU cost as well.=20 =46or the regular search, we scale the number of data pages by the number o= f=20 search entries. Best regards, =2D- Ronan Dunklau --nextPart4444252.LvFx2qVVIh Content-Disposition: attachment; filename="v4-0001-Extract-the-cpu-page-process-cost-multiplier-into.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="v4-0001-Extract-the-cpu-page-process-cost-multiplier-into.patch"