Re: Partition pruning on parameters grouped into an array does not prune properly
От | Andrei Lepikhov |
---|---|
Тема | Re: Partition pruning on parameters grouped into an array does not prune properly |
Дата | |
Msg-id | 1e54280e-d45e-4a6a-89a3-3a4f214113c9@gmail.com обсуждение исходный текст |
Ответ на | Re: Partition pruning on parameters grouped into an array does not prune properly (David Rowley <dgrowleyml@gmail.com>) |
Список | pgsql-hackers |
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 (a int, b int) PARTITION BY RANGE (a, b); CREATE TABLE part1 PARTITION OF parted FOR VALUES FROM (1, 1) TO (1, 10); CREATE TABLE part2 PARTITION OF parted FOR VALUES FROM (2, 1) TO (2, 10); INSERT INTO parted (VALUES (1, 2)); INSERT INTO parted VALUES (2, 2); EXPLAIN (COSTS OFF) SELECT * FROM parted WHERE a > 1 AND b < 1; EXPLAIN (COSTS OFF) SELECT * FROM parted WHERE a > 1 AND b > 10; /* Seq Scan on part2 parted Filter: ((a > 1) AND (b < 1)) Seq Scan on part2 parted Filter: ((a > 1) AND (b > 10)) */ I think partition part2 could be pruned like in the following example: EXPLAIN (COSTS OFF) SELECT * FROM parted WHERE a > 2 AND b > 10; /* Result One-Time Filter: false */ -- regards, Andrei Lepikhov
В списке pgsql-hackers по дате отправления: