Re: Prune partitions by ScalarArrayOpExpr with an array parameter (partkey = ANY($1)) - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Prune partitions by ScalarArrayOpExpr with an array parameter (partkey = ANY($1))
Date
Msg-id CAFj8pRCUy6nipGfEBYrhAoOQbCJZtwCiWuvmL_u=Vh3qTxEgsg@mail.gmail.com
Whole thread Raw
In response to Prune partitions by ScalarArrayOpExpr with an array parameter (partkey = ANY($1))  (Andrei Lepikhov <lepihov@gmail.com>)
List pgsql-hackers


po 17. 3. 2025 v 14:28 odesílatel Andrei Lepikhov <lepihov@gmail.com> napsal:
Hi,

As I see, initial pruning doesn't work in the case when a
ScalarArrayOpExpr contains a parameter as the RHS of the expression,
like following:

partkey = ANY($1)

As colleagues say, it is quite typical to use stored procedures, pass an
array of IDs as a parameter, and use it in a SELECT clause.

So, here I propose a patch that extends pruning machinery. It is nothing
innovative or complicated, but I'm not sure it is fully operational so
far: it may need some discussion, review and polishing.

I intended to add it to the next commitfest if this feature makes sense.

+1

Pavel


--
regards, Andrei Lepikhov

pgsql-hackers by date:

Previous
From: Srirama Kucherlapati
Date:
Subject: RE: AIX support
Next
From: Masahiko Sawada
Date:
Subject: Re: Skip collecting decoded changes of already-aborted transactions