Re: Should we add GUCs to allow partition pruning to be disabled?
От
Amit Langote
Тема
Re: Should we add GUCs to allow partition pruning to be disabled?
Дата
Msg-id
37bf0530-4f9d-7ee5-f2a8-516d79b885aa@lab.ntt.co.jp
Ответ на
Список
Дерево обсуждения
Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Justin Pryzby <pryzby@telsasoft.com>
Re: Should we add GUCs to allow partition pruning to be disabled? "David G. Johnston" <david.g.johnston@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? "David G. Johnston" <david.g.johnston@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Jim Finnerty <jfinnert@amazon.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Should we add GUCs to allow partition pruning to be disabled? Robert Haas <robertmhaas@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Robert Haas <robertmhaas@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@2ndquadrant.com>
Should we add GUCs to allow partition pruning to be disabled? "David G. Johnston" <david.g.johnston@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Bruce Momjian <bruce@momjian.us>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Bruce Momjian <bruce@momjian.us>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Justin Pryzby <pryzby@telsasoft.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? "David G. Johnston" <david.g.johnston@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Justin Pryzby <pryzby@telsasoft.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Robert Haas <robertmhaas@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Justin Pryzby <pryzby@telsasoft.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? Justin Pryzby <pryzby@telsasoft.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? Robert Haas <robertmhaas@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? Robert Haas <robertmhaas@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Justin Pryzby <pryzby@telsasoft.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Justin Pryzby <pryzby@telsasoft.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? Robert Haas <robertmhaas@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Robert Haas <robertmhaas@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Robert Haas <robertmhaas@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? Robert Haas <robertmhaas@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <amitlangote09@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Justin Pryzby <pryzby@telsasoft.com>
documentation fixes for partition pruning, round two Justin Pryzby <pryzby@telsasoft.com>
Re: documentation fixes for partition pruning, round two Alvaro Herrera <alvherre@2ndquadrant.com>
Re: documentation fixes for partition pruning, round three Justin Pryzby <pryzby@telsasoft.com>
Re: documentation fixes for partition pruning, round three Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: documentation fixes for partition pruning, round three Alvaro Herrera <alvherre@2ndquadrant.com>
Re: documentation fixes for partition pruning, round three David Rowley <david.rowley@2ndquadrant.com>
Re: documentation fixes for partition pruning, round three Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: documentation fixes for partition pruning, round three Alvaro Herrera <alvherre@2ndquadrant.com>
Re: documentation fixes for partition pruning, round two David Rowley <david.rowley@2ndquadrant.com>
Re: documentation fixes for partition pruning, round two Justin Pryzby <pryzby@telsasoft.com>
Re: documentation fixes for partition pruning, round two Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: documentation fixes for partition pruning, round two Justin Pryzby <pryzby@telsasoft.com>
Re: documentation fixes for partition pruning, round two Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? "David G. Johnston" <david.g.johnston@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Robert Haas <robertmhaas@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? Michael Paquier <michael@paquier.xyz>
Re: Should we add GUCs to allow partition pruning to be disabled? "David G. Johnston" <david.g.johnston@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Robert Haas <robertmhaas@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? "David G. Johnston" <david.g.johnston@gmail.com>
Re: Should we add GUCs to allow partition pruning to be disabled? David Rowley <david.rowley@2ndquadrant.com>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Should we add GUCs to allow partition pruning to be disabled? Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Hi David.
Thanks for writing the patch.
On 2018/04/20 14:47, David Rowley wrote:
> On 20 April 2018 at 14:07, Amit Langote wrote:
>> To clarify: if we're going to add a new parameter *for partitioned tables*
>> to configure whether or not pruning occurs, even if UPDATE and DELETE now
>> rely on constraint exclusion for pruning, we should ignore the setting of
>> constraint_exclusion the configuration parameter. For UPDATE and DELETE,
>> if enable_partition_pruning is on, we proceed to prune using constraint
>> exclusion (because that's the only method available now), irrespective of
>> the setting of constraint_exclusion.
>>
>> So to users, enable_partition_pruning should be the only way to configure
>> whether or not pruning occurs.
>
> I hope the attached implements what is being discussed here.
>
> Please test it to ensure it behaves as you'd expect.
>
> I was a little unsure if the new GUCs declaration should live in
> costsize.c or not since it really has no effect on plan costs, but in
> the end, I stuck it there anyway so that it can be with its friends.
The patch looks good except one thing, which I was trying to emphasize
shouldn't be the behavior.
drop table p;
create table p (a int) partition by list (a);
create table p1 partition of p for values in (1);
create table p2 partition of p for values in (2);
set enable_partition_pruning to off;
-- ok
explain select * from p where a = 1;
QUERY PLAN
----------------------------------------------------------
Append (cost=0.00..83.88 rows=26 width=4)
-> Seq Scan on p1 (cost=0.00..41.88 rows=13 width=4)
Filter: (a = 1)
-> Seq Scan on p2 (cost=0.00..41.88 rows=13 width=4)
Filter: (a = 1)
(5 rows)
reset enable_partition_pruning;
-- ok
explain select * from p where a = 1;
QUERY PLAN
----------------------------------------------------------
Append (cost=0.00..41.94 rows=13 width=4)
-> Seq Scan on p1 (cost=0.00..41.88 rows=13 width=4)
Filter: (a = 1)
(3 rows)
set enable_partition_pruning to off;
-- ok
explain update p set a = 2 where a = 1;
QUERY PLAN
-----------------------------------------------------------
Update on p (cost=0.00..83.75 rows=26 width=10)
Update on p1
Update on p2
-> Seq Scan on p1 (cost=0.00..41.88 rows=13 width=10)
Filter: (a = 1)
-> Seq Scan on p2 (cost=0.00..41.88 rows=13 width=10)
Filter: (a = 1)
(7 rows)
reset enable_partition_pruning;
-- ok
explain update p set a = 2 where a = 1;
QUERY PLAN
-----------------------------------------------------------
Update on p (cost=0.00..41.88 rows=13 width=10)
Update on p1
-> Seq Scan on p1 (cost=0.00..41.88 rows=13 width=10)
Filter: (a = 1)
(4 rows)
set constraint_exclusion to off;
-- not ok!
explain update p set a = 2 where a = 1;
QUERY PLAN
-----------------------------------------------------------
Update on p (cost=0.00..83.75 rows=26 width=10)
Update on p1
Update on p2
-> Seq Scan on p1 (cost=0.00..41.88 rows=13 width=10)
Filter: (a = 1)
-> Seq Scan on p2 (cost=0.00..41.88 rows=13 width=10)
Filter: (a = 1)
(7 rows)
I think we should teach relation_excluded_by_constraints() to forge ahead
based on the value of enable_partition_pruning, ignoring whatever
constraint_exclusion has been set to. What do you think of doing that
sort of thing?
Thanks,
Amit
В списке pgsql-hackers по дате отправления
От: Amit Langote
Дата:
От: Pavel Stehule
Дата: