Re: Adjust Memoize hit_ratio calculation

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Subject: Re: Adjust Memoize hit_ratio calculation
Date: 2023-03-21 19:48:16
Message-ID: CAApHDvqOm_ANNwXdJQFSA2g_tszgDeWGJ+_M3FiyUzN9XnEutw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 21 Mar 2023 at 09:41, David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
> Because that's being changed in v16, I think it might also be a good
> idea to fix the hit_ratio calculation problem reported by David
> Johnston in [1]. In the attached, I've adjusted David's calculation
> slightly so that we divide by Max(ndistinct, est_cache_entries)
> instead of ndistinct. This saves from overestimating when ndistinct
> is smaller than est_cache_entries. I'd rather fix this now for v16
> than wait until v17 and further adjust the Memoize costing.

I've now pushed this change.

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-03-21 19:58:05 Re: Save a few bytes in pg_attribute
Previous Message Corey Huinker 2023-03-21 19:33:15 Re: Add SHELL_EXIT_CODE to psql