pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: David Rowley <david.rowley@2ndquadrant.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Jesper Pedersen <jesper.pedersen@redhat.com>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Maksim Milyutin <milyutinma@gmail.com>
Subject: Re: [HACKERS] Proposal: Local indexes for partitioned table
Date: Fri, 5 Jan 2018 16:57:33 -0500
Message-ID: <803ac362-d8ef-ba67-daf5-b3263718070b@2ndquadrant.com> (raw)
In-Reply-To: <CAKJS1f89c4ndrnkY2ZferWg5bShpKEWYXX_Tmyyr5vBoPdTBNA@mail.gmail.com>
References: <584730ad-6736-10bc-b5fa-251d4873b8ad@2ndquadrant.com>
	<20180104220133.6sa4zpf5liurxhte@alvherre.pgsql>
	<CAKJS1f89c4ndrnkY2ZferWg5bShpKEWYXX_Tmyyr5vBoPdTBNA@mail.gmail.com>

On 1/4/18 23:08, David Rowley wrote:
> On 5 January 2018 at 11:01, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>> (The more I think of this, the more I believe that pg_inherits is a
>> better answer.  Opinions?)
> 
> I admit to not having had a chance to look at any code with this yet,
> but I'm just thinking about a case like the following.
> 
> CREATE TABLE part (a INT, b INT) PARTITION BY RANGE (a);
> CREATE TABLE part_a1 PARTITION OF part FOR VALUES FROM (0) TO (10)
> PARTITION BY RANGE (b);
> CREATE TABLE part_a1_b1 PARTITION OF part_a1 FOR VALUES FROM (0) TO (10);
> 
> CREATE INDEX ON part_a1 (a); -- sub-partition index (creates index on
> part_a1_b1)
> 
> CREATE INDEX ON part (a); -- What do we do here?
> 
> Should we:
> 
> 1. Create another identical index on part_a1_b1; or
> 2. Allow the existing index on part_a1_b1 to have multiple parents; or
> 3. ERROR... (probably not)

4. It should adopt part_a1 and its subindexes into its hierarchy.  That
shouldn't be a problem under the current theory, should it?

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (142+ messages)  latest in thread

Message-ID: <803ac362-d8ef-ba67-daf5-b3263718070b@2ndquadrant.com>
Permalink:  ../803ac362-d8ef-ba67-daf5-b3263718070b@2ndquadrant.com/
Also on:    postgresql.org/message-id/803ac362-d8ef-ba67-daf5-b3263718070b@2ndquadrant.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, david.rowley@2ndquadrant.com, alvherre@alvh.no-ip.org, robertmhaas@gmail.com, Langote_Amit_f8@lab.ntt.co.jp, jesper.pedersen@redhat.com, simon@2ndquadrant.com, milyutinma@gmail.com
  Subject: Re: [HACKERS] Proposal: Local indexes for partitioned table
  In-Reply-To: <803ac362-d8ef-ba67-daf5-b3263718070b@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox