pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jesper Pedersen <jesper.pedersen@redhat.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: David Rowley <david.rowley@2ndquadrant.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: Mon, 8 Jan 2018 15:47:15 -0500
Message-ID: <3cc142e1-82c7-0d47-681b-59d519606f4e@redhat.com> (raw)
In-Reply-To: <20180108203638.6di3uo7r7vqfsvda@alvherre.pgsql>
References: <20180108203638.6di3uo7r7vqfsvda@alvherre.pgsql>

Hi Alvaro,

On 01/08/2018 03:36 PM, Alvaro Herrera wrote:
> Jesper Pedersen wrote:
> 
>> Maybe a warning for existing indexes on the same column(s), but with a
>> different type, should be emitted during ATTACH, e.g.
> 
>> [detach one partition, replace index with a different one, attach
>> partition]
> 
>> Of course, this could also fall under index maintenance and no warning
>> emitted. Docs have "Each partition is first checked to determine whether an
>> equivalent index already exists," so it is covered.
> 
> Yeah, I'm of two minds about this also -- in the initial versions I had
> a code comment wondering exactly about having a hash index in a
> partition attached to a btree index on parent.
> 
> As another example, having a documents table with two partitions (one
> "long term archival" and other "documents currently being messed with")
> you could have a text search index which is GIN in the former and GiST
> in the latter.  There is a performance argument for doing it that way,
> so it's not merely academic.
> 
> Anyway, while I think attaching an index that doesn't match the
> properties of the index on parent can be a useful feature, on the other
> hand it could be surprising (you end up losing an index because it was
> matched during attach that you didn't think was going to be matched).
> One idea would be to have a way to specify at ATTACH time what to do
> about indexes when they don't match exactly, but I think the user
> interface would be pretty messy: exactly how different do you want to
> allow the indexes to be?  Is an index having one more column than the
> one in parent good enough?  I think the answer to this is mostly a
> judgement call, and I'd rather not spend my time debating those.
> 

Yeah, agreed - lets leave as is.

Migrating an index to another type would mean to drop the top-level 
definition anyway.

Best regards,
  Jesper




view thread (142+ messages)  latest in thread

Message-ID: <3cc142e1-82c7-0d47-681b-59d519606f4e@redhat.com>
Permalink:  ../3cc142e1-82c7-0d47-681b-59d519606f4e@redhat.com/
Also on:    postgresql.org/message-id/3cc142e1-82c7-0d47-681b-59d519606f4e@redhat.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: jesper.pedersen@redhat.com, alvherre@alvh.no-ip.org, Langote_Amit_f8@lab.ntt.co.jp, robertmhaas@gmail.com, david.rowley@2ndquadrant.com, simon@2ndquadrant.com, milyutinma@gmail.com
  Subject: Re: [HACKERS] Proposal: Local indexes for partitioned table
  In-Reply-To: <3cc142e1-82c7-0d47-681b-59d519606f4e@redhat.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