Re: Partition pruning on parameters grouped into an array does not prune properly

2025-04-10 Thread Amit Langote
On Thu, Mar 27, 2025 at 9:59 AM David Rowley wrote: > On Thu, 27 Mar 2025 at 04:19, Andrei Lepikhov wrote: > > But if we partition on HASH(x,y) it is not working (see > > incorrect-pruning-example.sql): > > > > PREPARE test2 (int,int) AS > > SELECT 1 FROM array_prune > > WHERE id1 = ANY(ARRAY

Re: Partition pruning on parameters grouped into an array does not prune properly

2025-03-31 Thread Andrei Lepikhov
On 3/27/25 01:58, David Rowley wrote: I suspect the fix for this might be a bit invasive to backpatch. Maybe it's something we can give a bit more clear thought to after the freeze is over. One more issue I think may be addressed (or just considered) here is the following: CREATE TABLE parted

Re: Partition pruning on parameters grouped into an array does not prune properly

2025-03-27 Thread Andrei Lepikhov
On 3/27/25 01:58, David Rowley wrote: I wonder if we need to redesign this to not do that recursive processing and instead have it so match_clause_to_partition_key() can generate multiple PartClauseInfos. If we've matched to the ScalarArrayOpExpr then I think each generated PartClauseInfo should

Re: Partition pruning on parameters grouped into an array does not prune properly

2025-03-26 Thread David Rowley
On Thu, 27 Mar 2025 at 04:19, Andrei Lepikhov wrote: > But if we partition on HASH(x,y) it is not working (see > incorrect-pruning-example.sql): > > PREPARE test2 (int,int) AS > SELECT 1 FROM array_prune > WHERE id1 = ANY(ARRAY[$1]) AND id2 = ANY(ARRAY[$2]); > EXPLAIN (COSTS OFF) EXECUTE test2