Re: Declarative partitioning - another take

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Declarative partitioning - another take
Date: 2016-11-15 09:51:42
Message-ID: b6518801-3d0a-0de4-d00b-a1a494deda8b@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016/11/11 20:49, Ashutosh Bapat wrote:
> I have not looked at the latest set of patches, but in the version
> that I have we create one composite type for every partition. This
> means that if there are thousand partitions, there will be thousand
> identical entries in pg_type. Since all the partitions share the same
> definition (by syntax), it doesn't make sense to add so many identical
> entries. Moreover, in set_append_rel_size(), while translating the
> expressions from parent to child, we add a ConvertRowtypeExpr instead
> of whole-row reference if reltype of the parent and child do not match
> (adjust_appendrel_attrs_mutator())
> if (appinfo->parent_reltype != appinfo->child_reltype)
> {
> ConvertRowtypeExpr *r = makeNode(ConvertRowtypeExpr);
>
> I guess, we should set reltype of child to that of parent for
> declarative partitions.

Thanks for the suggestion. I agree that partitions having the same
reltype as the parent will help a number of cases including the one you
mentioned, but I haven't yet considered how invasive such a change will be.

Thanks,
Amit

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rushabh Lathia 2016-11-15 10:04:22 Re: Push down more UPDATEs/DELETEs in postgres_fdw
Previous Message Magnus Hagander 2016-11-15 09:38:27 Snapshot too old logging