Re: Fix var_eq_const: sum selectivity of all matching MCV entries instead of stopping at first match

From: Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>
To: ZizhuanLiu X-MAN <44973863(at)qq(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Damil Shahzad <shahzaddamil(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Fix var_eq_const: sum selectivity of all matching MCV entries instead of stopping at first match
Date: 2026-08-24 13:54:13
Message-ID: e14e50b2-ac7c-4c8d-9ee1-f17dd92ec527@tantorlabs.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Even with statistics_target set to its maximum 10 000, merging the two
loops would not bring  much benefit. So I agree with that from the start
- my earlier change does not really add much value.

The examples so far only show a single Seq Scan, where the more accurate
estimate does not change the plan. Could we see a case where the
corrected MCV sum actually changes the chosen plan rather than just the
row estimate?

--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC,
https://tantorlabs.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pierre Forstmann 2026-08-24 14:59:45 Re: Move system identifier generation to a common helper
Previous Message Nazir Bilal Yavuz 2026-08-24 13:13:38 Re: Use streaming read I/O when enabling data checksums online