Re: [HACKERS] Proposal: Local indexes for partitioned table

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Maksim Milyutin <m(dot)milyutin(at)postgrespro(dot)ru>
Subject: Re: [HACKERS] Proposal: Local indexes for partitioned table
Date: 2017-11-14 12:30:28
Message-ID: 20171114123027.3z7l75gg4cfuy24v@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Rowley wrote:
> On 15 November 2017 at 01:09, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
> > if a
> > partition exists which *doesn't* have the index, restoring things this
> > way would create the index in that partition too, which is unwanted
> > because the end state is different to what was in the dumped database.
>
> hmm, but surely the all those indexes must already exist if the
> partitioned index exists. Won't we be disallowing DROP INDEX of the
> leaf partition indexes if that index is marked as being part of the
> partitioned index?

In normal cases, sure -- but you can do ALTER INDEX DETACH on a
partition, then drop the index. This is useful for example if you want
to replace some partition's index because of bloat: create a replacement
index, detach the old one, attach the new one, drop the old one. Now
you probably don't *want* to take a pg_dump in the middle of this
process ... but pg_dump's charter is not to produce the output we think
would be most convenient to users most of the time, but rather to
accurately describe what is in the database.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rafia Sabih 2017-11-14 12:31:47 Re: [HACKERS] [POC] Faster processing at Gather node
Previous Message Magnus Hagander 2017-11-14 12:26:30 Re: [HACKERS] Re: proposal - psql: possibility to specify sort for describe commands, when size is printed