Re: [PATCH] Fix hashed ScalarArrayOp semantics for NULL LHS with non-strict comparators

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Chengpeng Yan <chengpeng_yan(at)outlook(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, cca5507 <cca5507(at)qq(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [PATCH] Fix hashed ScalarArrayOp semantics for NULL LHS with non-strict comparators
Date: 2026-04-23 05:32:43
Message-ID: CAApHDvrJMOReoQOOp-_bFAHH8NTbUPy5L-CwX5XQo_7m55YNMw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for looking.

On Thu, 23 Apr 2026 at 16:31, Chengpeng Yan <chengpeng_yan(at)outlook(dot)com> wrote:
> One possible improvement, though not
> a blocker, would be to defer the lhs-NULL handling until we actually
> encounter the first NULL on the lhs. That could avoid a bit of extra
> work in the common case where the lhs contains no NULLs.

I thought of it, but didn't do it as it meant having to keep a bit
more state to track if we've filled the cache yet, plus the extra
costs incurred to check if we've done it yet that would have to be
paid for every NULL lookup. We currently have to check if the hash
table has been set up already, so I felt more comfortable installing
the new code in with that.

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-04-23 05:33:16 Re: Question about criteria for adding items to the v19 open items wiki page
Previous Message Chao Li 2026-04-23 05:28:23 Re: Question about criteria for adding items to the v19 open items wiki page