Re: POC, WIP: OR-clause support for indexes - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: POC, WIP: OR-clause support for indexes
Date
Msg-id CAEudQArk002t_C9LGoeJWnw=iGKikt+gSa8Mh==muG00WS=qYA@mail.gmail.com
Whole thread Raw
In response to Re: POC, WIP: OR-clause support for indexes  (Andrei Lepikhov <a.lepikhov@postgrespro.ru>)
Responses Re: POC, WIP: OR-clause support for indexes
List pgsql-hackers
Em ter., 20 de fev. de 2024 às 00:18, Andrei Lepikhov <a.lepikhov@postgrespro.ru> escreveu:
On 19/2/2024 19:53, Ranier Vilela wrote:
> v17-0002
> 1) move the vars *arrayconst and *dest, to after if, to avoid makeNode
> (palloc).
> + Const   *arrayconst;
> + ScalarArrayOpExpr  *dest;
> +
> + pd = (PredicatesData *) lfirst(lc);
> + if (pd->elems == NIL)
> + /* The index doesn't participate in this operation */
> + continue;
>
> + arrayconst = lsecond_node(Const, saop->args);
> + dest = makeNode(ScalarArrayOpExpr);
Thanks for the review!
I'm not sure I understand you clearly. Does the patch in attachment fix
the issue you raised?
Sorry if I wasn't clear.
What I meant is to move the initializations of the variables *arrayconst* and *dest*
for after the test (if (pd->elems == NIL)
To avoid unnecessary initialization if the test fails.

best regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Streaming read-ready sequential scan code
Next
From: Tomas Vondra
Date:
Subject: Re: Change the bool member of the Query structure to bits