public inbox for [email protected]
help / color / mirror / Atom feedFrom: Ilia Evdokimov <[email protected]>
To: Zsolt Parragi <[email protected]>
Cc: Tatsuya Kawata <[email protected]>
Cc: David Geier <[email protected]>
Cc: Chengpeng Yan <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Hash-based MCV matching for large IN-lists
Date: Thu, 26 Feb 2026 11:57:26 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<CAHza6qdAH99C0xa27YDTixiNVFa99j90QYquUPAxL0JwahmggA@mail.gmail.com>
<[email protected]>
<CAN4CZFPb+iqQkby4AGvZSvL2OkwQ+S9CVvmJiQ=u6cckWPetqA@mail.gmail.com>
<[email protected]>
On 2/26/26 01:45, Ilia Evdokimov wrote:
> About op_is_reserved. It seems we should assign op_is_reserved = true,
> because we don't reverse types like eqjoinsel_semi(). If IN-list
> smaller than MCV-list we reverse it by fmgr_info(hash_mcv ? hashLeft :
> hashRight, &hash_proc). Thanks for this remark.
>
I guess I rushed to conclusions. This assignment op_is_reversed = true
was incorrect. During lookups, simplehash passes: key0 as the value
stored in the hash table, key1 as the probe value. Since MCV entries
correspond to the variable's statistics, the correct argument order
depends on which side we build the hash table on. If we hash MCV values
(hash_mcv = true), then key0 = MCV value, key1 = IN-list value, so we
must call operator(key0, key1). If we hash IN-list elements (hash_mcv =
fasle), then key0 = IN-list value, key1 = MCV value and we must call
operator(key1, key0). Therefore the correct assignment is
hashContext.op_is_reversed = hash_mcv.
If you have another suggestions to v6 patches, send them, and I'll fix
them with hashContext.op_is_reversed = hash_mcv.
--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC,
https://tantorlabs.com/
view thread (7+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Hash-based MCV matching for large IN-lists
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox