Re: BUG #19789: "expression not found in statistics object" for a boolean domain column in an MCV statistics object

From: Matheus Alcantara <matheusssilv97(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>, ZizhuanLiu X-MAN <44973863(at)qq(dot)com>
Cc: alpkeles99 <alpkeles99(at)gmail(dot)com>, pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #19789: "expression not found in statistics object" for a boolean domain column in an MCV statistics object
Date: 2026-11-30 11:57:34
Message-ID: 28114a03-e884-425a-aedd-0ef1180ca65d@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 29/11/26 22:12, Michael Paquier wrote:
> On Sun, Nov 29, 2026 at 08:45:31PM +0800, ZizhuanLiu X-MAN wrote:
>> I reviewed the patch and think both changes are correct and
>> consistent with the existing compatibility check.
>
> Yeah. That looks right.
>
> +SELECT * FROM check_estimated_rows('SELECT * FROM mcv_lists_bool_domain WHERE a AND b AND c = 0');
> +SELECT * FROM check_estimated_rows('SELECT * FROM mcv_lists_bool_domain WHERE NOT a AND b');
> +SELECT * FROM check_estimated_rows('SELECT * FROM mcv_lists_bool_domain WHERE a = true AND b = false');
> +SELECT * FROM check_estimated_rows('SELECT * FROM mcv_lists_bool_domain WHERE (a OR b) AND c = 1');
> +SELECT * FROM check_estimated_rows('SELECT * FROM mcv_lists_bool_domain WHERE a AND (c > 4)::mcv_bool_domain');
>
> I don't think that you need that many queries here. It would be
> enough to cut that down to two patterns, as of:
> WHERE a AND b;
> WHERE NOT a AND b;
>
> Will simplify and process that. Thanks for the report and the
> patch!
Thank you ZizhuanLiu for reviewing the patch and thank you Michael for
committing.

--
Matheus Alcantara
EDB: https://www.enterprisedb.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Ishjaap Singh 2026-11-30 12:39:53 Re: BUG #19957: jsonpath `last` returns the wrong index after a filter containing `exists($x[0])`
Previous Message Raja Sai pranav 2026-11-30 11:23:40 Re: BUG #19928: pg_upgrade fails on v18 schema with NOT NULL ... NO INHERIT and inheritance