Re: [HACKERS] Proposal: Local indexes for partitioned table - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [HACKERS] Proposal: Local indexes for partitioned table
Date
Msg-id 20171027172730.eh2domlkpn4ja62m@alvherre.pgsql
Whole thread Raw
In response to Re: [HACKERS] Proposal: Local indexes for partitioned table  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: [HACKERS] Proposal: Local indexes for partitioned table
List pgsql-hackers
Alvaro Herrera wrote:

> I'm now working on the ability to build unique indexes (and unique
> constraints) on top of this.

So I think there's not a lot of additional code required to support
unique indexes with the restrictions mentioned; proof-of-concept (with
several holes still) attached.

As before, this is not finished, as there a few things that are wrong
(such as generateClonedIndexStmt taking a RangeVar), and others that I
don't understand (such as why is rd_partkey NULL for partitioned
partitions when DefineIndex cascades to them and the columns are
checked).

I noticed that RelationBuildPartitionKey is generating a partition key
in a temp context, then creating a private context and copying the key
into that.  That seems leftover from some previous iteration of some
other patch; I think it's pretty reasonable to create the new context
right from the start and allocate the key there directly instead.  Then
there's no need for copy_partition_key at all.

Anyway, here is a preliminary submission before I close shop for the
week.

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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Nico Williams
Date:
Subject: Re: [HACKERS] WIP: BRIN bloom indexes
Next
From: Tom Lane
Date:
Subject: [HACKERS] ALTER COLUMN TYPE vs. domain constraints