Re: Poor row estimates from planner, stat `most_common_elems` sometimes missing for a text[] column

From: Frédéric Yhuel <frederic(dot)yhuel(at)dalibo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Mark Frost <FROSTMAR(at)uk(dot)ibm(dot)com>
Cc: "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Subject: Re: Poor row estimates from planner, stat `most_common_elems` sometimes missing for a text[] column
Date: 2025-06-06 08:07:38
Message-ID: 95e298e6-fdeb-4687-97cf-27942c1f0856@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 6/5/25 23:52, Tom Lane wrote:
> The idea of treating lack of MCELEM differently from complete
> lack of stats still seems to have merit, though.

Couldn't we count / estimate the number of distinct two-by-two elements,
and use that instead of the default selectivity estimate?

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Mark Frost 2025-06-06 09:21:34 RE: Poor row estimates from planner, stat `most_common_elems` sometimes missing for a text[] column
Previous Message Tom Lane 2025-06-05 21:52:53 Re: Poor row estimates from planner, stat `most_common_elems` sometimes missing for a text[] column