Re: Hash-based MCV matching for large IN-lists - Mailing list pgsql-hackers

From Ilia Evdokimov
Subject Re: Hash-based MCV matching for large IN-lists
Date
Msg-id 8ee9d903-bb13-434c-8145-b3769bf2b3cb@tantorlabs.com
Whole thread Raw
In response to Re: Hash-based MCV matching for large IN-lists  (Chengpeng Yan <chengpeng_yan@Outlook.com>)
List pgsql-hackers

Hi Chengpeng,

Thanks for your review!


On 28.01.2026 16:08, Chengpeng Yan wrote:
* Treat NULL array elements as zero selectivity for ALL:

Agreed. For ALL/AND semantics the function now returns selectivity = 0.0 as soon as a NULL element is encountered.


* Fix cross-type equality argument order in `mcvs_in_equal`:

Agreed. Added 'op_is_reserved' flag MCVInHashContext, same as in MCVHashContext.


* Include non-MCV IN-list constants in non-disjoint selectivity:

This is not applicable to v3.


* Avoid double-negating inequality estimates for non-Const elements:

Agreed. var_eq_non_const() is now always with negate = false, not to call negation twice.


Attached v4 patch with above fixes.

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

Attachment

pgsql-hackers by date:

Previous
From: Ajin Cherian
Date:
Subject: Re: Fix logical decoding not track transaction during SNAPBUILD_BUILDING_SNAPSHOT
Next
From: shveta malik
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication