Re: Extended statistics improvement: multi-column MCV missing values

From: Enrique Sánchez <enriqueesanchz(at)gmail(dot)com>
To: Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>
Cc: Chengpeng Yan <chengpeng_yan(at)outlook(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Subject: Re: Extended statistics improvement: multi-column MCV missing values
Date: 2026-06-16 22:32:40
Message-ID: CAOCkzAnpimojq1=+KqdVco37K9v0TiDgC2uQ+QBNfkDcjR0Gqg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 15/06/26 23:13, Ilia Evdokimov wrote:

> It's generally not safe to compare floating-point values for equality. I
> mean using `mcv_sel == 0.0` to detect that there are no extended MCV
> matches. IMO, we should use a bool variable (similar to how var_eq_const()
> does it) to track whether any MCV item matched, specifically in the loop
> where we check extended MCV matches in mcv_clauselist_selectivity().
>
Makes sense, I've fixed it in v5-0002.

I've also created a commit fest entry for this patch:
https://commitfest.postgresql.org/patch/6898/

Best regards,
Enrique.

Attachment Content-Type Size
v5-0001-Cap-selectivity-when-values-are-not-in-multi-colu.patch text/x-patch 11.4 KB
v5-0002-Use-ndistinct-to-cap-non-MCV-values.patch text/x-patch 13.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-06-16 22:47:42 Re: Make frontend programs relink after libpgfeutils changes
Previous Message surya poondla 2026-06-16 22:21:12 Re: Improving psql autocompletion for SET LOCAL / SET SESSION