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 1p15cZ-000263-Uo for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Dec 2022 12:58:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p15cY-0007bl-Ou for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Dec 2022 12:58:26 +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 1p15cY-0007bb-Dz for pgsql-hackers@lists.postgresql.org; Fri, 02 Dec 2022 12:58:26 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p15cS-0007Yg-9M for pgsql-hackers@lists.postgresql.org; Fri, 02 Dec 2022 12:58:25 +0000 Received: by mail-wr1-x434.google.com with SMTP id h12so7632954wrv.10 for ; Fri, 02 Dec 2022 04:58:20 -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=cwqOKrzYhjYrbZrWQZUo8e0zpseMeMBnlwPAQb0vMBk=; b=UGCinUdLC9s1/KlZLMidJisVbCULk+2T/2qnP3DYICrbUKQGW+UM1vqXuTI7fvv7Pc vVvq76l6fkqDOOXOLUwEYX0WhdKTQHmD4ykGsnce7K2bDEp6QYIjRrVTYfZmA7p6GZ7E ZgLpSjG9HCVRa+jJUkGJxn6xLetIcBA8+fWpo= 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=cwqOKrzYhjYrbZrWQZUo8e0zpseMeMBnlwPAQb0vMBk=; b=1kCxg01Z9pUi9DepNQ2hrbUFVI9iUnq5E+6XP+sByrf/OMscYouP8FznuCfspGpoRn WkBQdiuzwCLpPMSEG5Y7DsJ/Vl/kUaVFcIaN83eTkXpGLLsWhyw40vSWw732U4e/pm/K ClCaQUy9iUzB5Rsk07tg9JszwB8KIoLM1pXXL+7N8APRf2aSwafnQHfU0ddgrE83jFuO JCQqeyrPSaDTFDtxzWDytrQfxOvZQygVAwj6MeLj6+MoPYHz3GAygHOOwwmuz/10rw6H +oLc/q2Sd5c2DF0YdTYHI2eUdBRakJV4DZOFVKx/OkiNFSMoLivbjAemzST7Sy7NIEDn NCIQ== X-Gm-Message-State: ANoB5pn7YLLttDdyk12H3ia3OguIkhrWKaxdFSaM30wwo0GFvEcbSsaX v1xptVX0j7f9ecUa6RHirZw90Q== X-Google-Smtp-Source: AA0mqf41Yv2FAYIYjURHtH5xVCO5DwHv4TtMCR/Vw0TNyjDIkXt36zS+GMu5rGYj6bCfye4O/uunzQ== X-Received: by 2002:adf:f18d:0:b0:242:11ef:7748 with SMTP id h13-20020adff18d000000b0024211ef7748mr16927729wro.605.1669985898847; Fri, 02 Dec 2022 04:58:18 -0800 (PST) Received: from aivenlaptop.localnet ([45.13.105.93]) by smtp.gmail.com with ESMTPSA id n14-20020a05600c4f8e00b003c6f3f6675bsm13604341wmq.26.2022.12.02.04.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 04:58:18 -0800 (PST) From: Ronan Dunklau To: Alexander Korotkov Cc: Tom Lane , Michael Paquier , pgsql-hackers@lists.postgresql.org Subject: Re: Fix gin index cost estimation Date: Fri, 02 Dec 2022 13:58:27 +0100 Message-ID: <10184681.nUPlyArG6x@aivenlaptop> In-Reply-To: References: <3188617.44csPzL39Z@aivenronan> <13151261.uLZWGnKmhe@aivenlaptop> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Le vendredi 2 d=C3=A9cembre 2022, 12:33:33 CET Alexander Korotkov a =C3=A9c= rit : > 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. This is what is used in other tree-descending estimation functions, so I u= sed=20 that too. Maybe a DEFAULT_PAGE_CPU_COST macro would work for both ? If so I= 'll=20 separate this into two patches, one introducing the macro for the other=20 estimation functions, and this patch for gin. > 2) "We only charge one data page for the startup cost" =E2=80=93 should t= his > be dependent on number of search entries? Good point, multiplying it by the number of search entries would do the tri= ck.=20 Thank you for looking at this ! Regards, =2D- Ronan Dunklau