Re: Restriction on table partition expressions

From: James Vanns <jvanns(at)ilm(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Restriction on table partition expressions
Date: 2022-08-26 08:50:26
Message-ID: CAH7vdhNupeP4Ahv41pqsB-EWazJtGtTas9U1HV_cQEJgoR6U5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for that, David. It makes sense and no, it certainly wouldn't
do to have a global index across all the partitions! It sounds like
the key thing that needs highlighting is if the result of an
expression (function call in this case) cannot guarantee the
uniqueness of the value across all partitions, then that is why it's
forbidden.

Cheers

Jim

On Thu, 25 Aug 2022 at 16:32, David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
>
> On Fri, 26 Aug 2022 at 03:08, James Vanns <jvanns(at)ilm(dot)com> wrote:
> > Also, is there a chance that this
> > limitation will be relaxed in the future?
>
> (forgot to answer this part)
>
> Certainly not in the near future, I'm afraid. It would require
> allowing a single index to exist over multiple tables. There has been
> discussions about this in the past and the general thoughts are that
> if you have a single index over all partitions, then it massively
> detracts from the advantages of partitioning. With partitioning, you
> can DETACH or DROP a partition and get rid of all the data quickly in
> a single metadata operation. If you have an index over all partitions
> then that operation is no longer a metadata-only operation. It
> suddenly needs to go and remove or invalidate all records pointing to
> the partition you want to detach/drop.
>
> David

--
Jim Vanns
Principal Production Engineer
Industrial Light & Magic, London

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lahnov, Igor 2022-08-26 11:43:47 RE: Unable to start replica after failover
Previous Message David G. Johnston 2022-08-26 06:28:27 Re: In a partition why 1st time encounter NULL then call minvfunc