Re: Re: Partitioning such that key field of inherited tables no longer retains any selectivity
От
Rafał Pietrak
Тема
Re: Re: Partitioning such that key field of inherited tables
no longer retains any selectivity
Дата
Msg-id
536FF41B.1050205@ztk-rp.eu
Ответ на
Re: Partitioning such that key field of inherited tables no longer
retains any selectivity (David G Johnston)
Список
Дерево обсуждения
Partitioning such that key field of inherited tables no longer
retains any selectivity Tim Kane <tim.kane@gmail.com>
Re: Partitioning such that key field of inherited tables no longer
retains any selectivity David G Johnston <david.g.johnston@gmail.com>
Re: Re: Partitioning such that key field of inherited tables no longer retains any selectivity Tom Lane <tgl@sss.pgh.pa.us>
Re: Re: Partitioning such that key field of inherited
tables no longer retains any selectivity Tim Kane <tim.kane@gmail.com>
Re: Partitioning such that key field of inherited tables no longer
retains any selectivity David G Johnston <david.g.johnston@gmail.com>
Re: Re: Partitioning such that key field of inherited tables
no longer retains any selectivity Rafał Pietrak <rafal@ztk-rp.eu>
W dniu 11.05.2014 22:01, David G Johnston pisze:
[------------------]
This is basically what I intended to describe in "option 2"...without the benefit of ever having really read the SQL standard.So the planner would have to know that, for a given table, the generation expression results in a constant - would likely in fact have to be a constant expression like, assuming a non-number value, ='column_value', where the "=" sign indicates that this is a generation expression and not a stored value (like default behaves currently).
wouldn't it be ways better, if the constraints for partitioning by inharitance were set at the "master" table, instead of the way it's currently done at the inharited tables (as exclusive CHECK-s there)?
I mean a constraint like a "function(table columns) reutrning table_name or tablespace_name of the actual target table"?
<start preudocode>
create table master (a int, b int, c int);
create table table_a (inharits master);
create table table_b (inharits master);
create function(a,b) returns text as $$ if a > b then return "table_a" else return "table_b"; end if; end $$
... or:
create function(a,b) returns tablespace as $$ if a > b then return tablespace("table_a") else return tablespace("table_b"); end if; end $$
alter table master add constraint "partitioning" check/select/route function(a,b);
<end pseudocode>
-R
В списке pgsql-general по дате отправления
От: Gavin Flower
Дата: