Re: Binary search in ScalarArrayOpExpr for OR'd constant arrays

Zhihong Yu <zyu@yugabyte.com>

From: Zhihong Yu <zyu@yugabyte.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: James Coleman <jtc331@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Tomas Vondra <tomas.vondra@enterprisedb.com>, Michael Paquier <michael@paquier.xyz>, Andrew Dunstan <andrew@dunslane.net>, Peter Geoghegan <pg@bowt.ie>, Heikki Linnakangas <hlinnaka@iki.fi>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-05-08T08:21:44Z
Lists: pgsql-hackers
On Fri, May 7, 2021 at 9:50 PM David Rowley <dgrowleyml@gmail.com> wrote:

> On Sat, 8 May 2021 at 14:04, David Rowley <dgrowleyml@gmail.com> wrote:
> > I'm not opposed to adding some new field if that's what it takes.  I'd
> > imagine the new field will be something like negfuncid which will be
> > InvalidOid unless the hash function is set and useOr == false
>
> Just while this is still swapped into main memory, I've attached a
> patch that adds a new field to ScalarArrayOpExpr rather than
> repurposing the existing field.
>
> David
>

Hi,

+       if (!OidIsValid(saop->negfuncid))
+           record_plan_function_dependency(root, saop->hashfuncid);

Is there a typo in the second line ? (root, saop->negfuncid)

Cheers

Commits

  1. Use a hash table to speed up NOT IN(values)

  2. Speedup ScalarArrayOpExpr evaluation