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

From Andrei Lepikhov
Subject Prune partitions by ScalarArrayOpExpr with an array parameter (partkey = ANY($1))
Date
Msg-id b8cdd20f-b34b-42b9-8c7c-dae864b7b3b2@gmail.com
Whole thread Raw
Responses Re: Prune partitions by ScalarArrayOpExpr with an array parameter (partkey = ANY($1))
Re: Prune partitions by ScalarArrayOpExpr with an array parameter (partkey = ANY($1))
List pgsql-hackers
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.

-- 
regards, Andrei Lepikhov

Attachment

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Snapshot related assert failure on skink
Next
From: Steven Niu
Date:
Subject: Re: Forbid to DROP temp tables of other sessions