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 1u4j63-006TJN-MW for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Apr 2025 16:25:16 +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 1u4j61-00DC76-0K for pgsql-hackers@arkaria.postgresql.org; Tue, 15 Apr 2025 16:25:13 +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 1u4j60-00DC6I-Lb for pgsql-hackers@lists.postgresql.org; Tue, 15 Apr 2025 16:25:13 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u4j5z-000Dm9-16 for pgsql-hackers@lists.postgresql.org; Tue, 15 Apr 2025 16:25:12 +0000 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-abec8b750ebso974716166b.0 for ; Tue, 15 Apr 2025 09:25:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744734310; x=1745339110; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rvheIya7RGnuX4HINRy54HYrcHEHCYtYe9n+YZuSjGw=; b=YVPXwfvuFet7pX5g/ExvJoYT06aenbXLwmkbTq/gCdJ6YelM9cFafP0Bg1teO+rqI/ 0YVnUHbIILxU/VF6IJ7hVdqqP7Ufgy8pKYWv4KKf3RdUS9QMRNtghxQZKKbpxbBJ2eKh 8HCmV1GEpPUUXF9+V23z5kKL7g+LF3Aj6Hl1KdVd8TdL8iF82NQSSdjv9hr7o49uDOCu oxMszhwKBtyzpwVutQpAqG1gmph26cGlYE9FRQqnB/rA+SsGkvk+2aPErJK9ADhnaJq3 8ry/grO/ZkH4maWX5hyVkZ6dsujTg2qtCLdz8Phdwg/A05yVrGRgAqB/WGAFlFcUVgWV gjlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744734310; x=1745339110; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rvheIya7RGnuX4HINRy54HYrcHEHCYtYe9n+YZuSjGw=; b=j96P3UpQjRPMHk4/OLBQgICCHq0s8iBCo29TNq9HVH9FMHcg8Y7I2PnPdQVV1Znxhy 31ch9NVLjpmBeZt6vB/grY56BK8S6eoqvZ+ErD8ONiHV+4S7nAxTny/gbI3f71uD1/hT Bk04FQicW7NIBUX0/Aj8Tk5D6hJtBwhuKNI+YGTCRsy1lX/ARptW3ipl/L5bWqAOkvkL yam+6CqybRYge39l8LgCvfmf3eDIVNEJw70coYB3lAXuGUttjnNX0nO5DPdp5XPeLzav MGYro4MLxpdshJ5/t/ksAO84apsdjSKwEn923vFqax2mnzWgmdEICBuh3p8bCTOwh08a zcxg== X-Forwarded-Encrypted: i=1; AJvYcCW8ouEzo3IEQX+l+XRAejjYNqk9UgMlCZUXj3AmbT6OQYl3aLo+kjRJwsqvjxnScofujxQLICDaPqVcFGv6@lists.postgresql.org X-Gm-Message-State: AOJu0YzYrGpYuu/FUIrJ5P+fGEsV4WVjjCE2LzhtmbGgEYRbGMk0xHFK Cu6SXYfqxDPL+5OngRcpkSB75niPK9Q6ij9WxMApzBy3C4Xw8AzMwtYVLvzg+xW5rz0LGoWigGA /XSuUEVIpeuRB3iXW6IqXmbMyLls= X-Gm-Gg: ASbGncsmTfh+k/h0UC6qQtZGfmE/c4R0VEWmKX548eQ2pF6VwzEQwPtIQUykGklZxOo wK71foEU/T35sRHnHcN9vd7Txrqe6PK6x6fGzNINiyBnoE8weYm+EoMbfs1qbOXYPaXOBoGCM0v tiVoQC0c0KYdUhWTmHkkVm1PONIceV1QJX X-Google-Smtp-Source: AGHT+IEcfdRA1Oa6gPSu7/MiFmvukNt0fAhiA+LKx/oCld+q16eN8KhJYNuV5thmkM7aFy8xl8lWmJhoPYjJgDBdXvI= X-Received: by 2002:a17:907:1c13:b0:aca:c507:a4e8 with SMTP id a640c23a62f3a-acad3493c45mr1338124966b.21.1744734309768; Tue, 15 Apr 2025 09:25:09 -0700 (PDT) MIME-Version: 1.0 References: <11c709e1-9b17-4c00-9ead-93609a09b9db@gmail.com> <1161645.1742854534@sss.pgh.pa.us> <1164845.1742856354@sss.pgh.pa.us> <3ba16aa7-3cb2-4289-b773-522ae2f03a77@tantorlabs.com> <81ef0f5a-b6a1-4417-ae3a-2bae9b8d419e@gmail.com> <67b5c84a-dedd-4103-af7e-0117046102fe@tantorlabs.com> <580fe72c-85be-45a8-9e00-6b5417690557@tantorlabs.com> <3ea66a50-e4b0-4f20-ae0c-4d9cbaf81cfb@tantorlabs.com> In-Reply-To: From: Robert Haas Date: Tue, 15 Apr 2025 12:24:57 -0400 X-Gm-Features: ATxdqUEAbQ599jjFcO9fPlgfjF0--5zanw6qCB4_ft2gCdIYDZZEhqWbeCXDhyA Message-ID: Subject: Re: Add estimated hit ratio to Memoize in EXPLAIN to explain cost adjustment To: David Rowley Cc: Ilia Evdokimov , Tom Lane , Lukas Fittl , Daniel Gustafsson , PostgreSQL Hackers , Nikolay Samokhvalov , Andrei Lepikhov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Apr 14, 2025 at 8:23=E2=80=AFPM David Rowley = wrote: > Maybe we could compress the text output a bit with: > > "Estimates: capacity=3DN distinct keys=3DN hit ratio=3DN.N%" Sure, that works for me. > If we get it that compact, maybe lookups could fit in there too, i.e.: > > "Estimates: capacity=3DN distinct keys=3DN lookups=3DN hit ratio=3DN.N%" Is lookups=3DN here the estimated number of lookups i.e. what we think nloops will end up being? --=20 Robert Haas EDB: http://www.enterprisedb.com