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 1twpvL-000YcM-DW for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Mar 2025 22:05:35 +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 1twpvJ-00AjPs-1X for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Mar 2025 22:05:33 +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 1twpvI-00AjPk-ML for pgsql-hackers@lists.postgresql.org; Mon, 24 Mar 2025 22:05:32 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1twpvG-000x9L-1L for pgsql-hackers@lists.postgresql.org; Mon, 24 Mar 2025 22:05:32 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-54acc04516fso4435086e87.0 for ; Mon, 24 Mar 2025 15:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742853930; x=1743458730; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=LRHq1z1GKaWLnPHKqNJnwAwO4pwmmzVKfD9sR1QpIW0=; b=czYbWjZ4dcEeI517AFH2ak0NKoB6KmNp6LOQsnZIsLLPrY5p0ObbigU/OvCcfaJDA1 qzPLv9MKtWQbuDfG+pv3/ekrS/xwnu6HOrabDNAknCuU5ZL15joKrB9IjHyWFnkKgBQe h486ZmNPT4Uua/eOYJROjHWW1N59wEnt3O6e8/Xq/wQkEEOjML/Dl4pbbk1uBSFKWH7b mKWpVxzCu/A5IM5yCDHPdI6O4rs17scse8TM2qoVRMDSCB7JOZ4USQpmQn0fynuQwxgi zPnOvso/UiCFB4B94dt0CWroDVsOrB0AoKHdwUNxZT5WF24yrdiY0AahmgBbRHn4G03X GVSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742853930; x=1743458730; h=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=LRHq1z1GKaWLnPHKqNJnwAwO4pwmmzVKfD9sR1QpIW0=; b=cHbi41CHEhrt4u5QvZdFQcLZTuUFigr/Orz8XLCu/tiTsbOt0lQy649p/feDOSRlgc rQADQGb0Ez55KNQVOOzJ+KIuzqgXaLycKnFsc7Q5hoAzjWQ0uxUm0cYFlF74CXt8Pkdd h6KLIC391e8n7+uZ9Ms4+IcHQBtXA65OvlxgQ0c4cZy8ZvvU0i4f5GtyqVKCP2QiPKNh yBoluwbclsH5loBxMtFIVZgvb0nq4ohvHWbeJ462MpmLUgYRAo2ymjxstGQimTalnjOy qjsxeixsWytVxbA6pjfSY1SlFLMFPTL+jQ36Vwxlo1+JF9x1Qx6q0IDEWgmoVhqF9zWw QmJA== X-Forwarded-Encrypted: i=1; AJvYcCXNA0RpkgTwOy3vum3Iw9FFtdgPsWRZDFehS/QnrW9dFnj3MDCUmSG+W67HXGKHG4cNlCprszirEAwGoaiH@lists.postgresql.org X-Gm-Message-State: AOJu0Yxsv1Vc7nzm0BBdJNUL01K6g6aEdfK04QGWlSucX2fDS+1hfsuC lnaXOmawLWSNA4KdSDsrI5MVCyA+nzChH4X0gq7a8FfCcssi3LIMKtYSGOeMXUsQhvCfVbLf0mk Ktzx7+VADX0J7ChT6TtmaBCeTXWE= X-Gm-Gg: ASbGnctQid4LizAlV/GiUkmsBz92s4HOTOeQdl5eOn5IxqhsPOPJZLVsLESuSWOT1X9 d9NBOlnfjsyBnxOvl1V/GXSo+x4hOv4AgP4eju/5oOqJWfcx9eDoxDmhb92SkikxUSIflnvDaVh gtyWT5nmPHh89ReOWZ6xCHFQKrQ2uF7TARIqCR1TKu7HPcYZDW7aknNt/JFjo= X-Google-Smtp-Source: AGHT+IH0bjvxGqs2v4xM15K/TbpbeHAI6R6kR1KqihYYITOr8XXK8opYyKb/Hq0LgzUlcmT4dVTo7uEi/lCohuocGGk= X-Received: by 2002:ac2:4e0a:0:b0:545:22ec:8b6b with SMTP id 2adb3069b0e04-54ad64ef04bmr5485973e87.35.1742853929455; Mon, 24 Mar 2025 15:05:29 -0700 (PDT) MIME-Version: 1.0 References: <51A15CD7-E31B-483D-B911-D0EB9F5FF952@yesql.se> <44229379-3901-4cb0-8812-b354ef70d5e2@gmail.com> <8e12aa55-39eb-4e03-a8f7-077fe02309c3@gmail.com> <11c709e1-9b17-4c00-9ead-93609a09b9db@gmail.com> In-Reply-To: <11c709e1-9b17-4c00-9ead-93609a09b9db@gmail.com> From: David Rowley Date: Tue, 25 Mar 2025 11:05:16 +1300 X-Gm-Features: AQ5f1JrqB5Lx9lz7gpMJJYAw5Fs3fgdS5B3bswZl2IM0yb16Qa6QEmaF_i7Flz4 Message-ID: Subject: Re: Add estimated hit ratio to Memoize in EXPLAIN to explain cost adjustment To: Andrei Lepikhov Cc: Ilia Evdokimov , Lukas Fittl , Daniel Gustafsson , PostgreSQL Hackers , Nikolay Samokhvalov Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 25 Mar 2025 at 10:23, Andrei Lepikhov wrote: > > On 3/23/25 22:16, David Rowley wrote: > > Once again, I'm not necessarily objecting to hit and evict ratios > > being shown, I just want to know they're actually useful enough to > > show and don't just bloat the EXPLAIN output needlessly. So far your > > arguments aren't convincing me that they are. > I'm -1 for this redundancy. I'm not following what the -1 is for. Is it for showing both hit and evict ratios? And your vote is only for adding hit ratio? Just to make it clear, the evict ratio isn't redundant because we show hit ratio. If you have 1000 calls and 1000 distinct values and enough memory to store those, then that's a 0% hit ratio since the first lookup is a miss. If you change the calls to 2000 then that's a 50% hit ratio and still 0% evict. David