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 14:50:02 -0500
Message-ID: <56399791-7fb6-0a80-8d24-3428fcdd96d3@redhat.com> (raw)
In-Reply-To: <20180104143010.bnmryjsqix4p24a7@alvherre.pgsql>
References: <20180104143010.bnmryjsqix4p24a7@alvherre.pgsql>

Hi Alvaro,

On 01/04/2018 09:30 AM, Alvaro Herrera wrote:
> v11 fixes the dependency problem I mentioned in
> https://postgr.es/m/20171229203818.pqxf2cyl4g2wre6h@alvherre.pgsql
> and adds some test to cover that stuff.
> 

Thanks, make check-world passes.

Maybe a warning for existing indexes on the same column(s), but with a 
different type, should be emitted during ATTACH, e.g.

-- test.sql --
CREATE TABLE test (a integer NOT NULL) PARTITION BY HASH(a);
CREATE TABLE test_p00 PARTITION OF test FOR VALUES WITH (MODULUS 2, 
REMAINDER 0);
CREATE TABLE test_p01 PARTITION OF test FOR VALUES WITH (MODULUS 2, 
REMAINDER 1);
CREATE INDEX idx_test_a ON test (a);

INSERT INTO test (SELECT i FROM generate_series(1, 1000000) AS i);

ANALYZE;

ALTER TABLE test DETACH PARTITION test_p00;
DROP INDEX test_p00_a_idx;
CREATE INDEX test_p00_a_idx ON test_p00 USING hash (a);
ALTER TABLE test ATTACH PARTITION test_p00 FOR VALUES WITH (MODULUS 2, 
REMAINDER 0);

-- test.sql --

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.

Best regards,
  Jesper




view thread (142+ messages)  latest in thread

Message-ID: <56399791-7fb6-0a80-8d24-3428fcdd96d3@redhat.com>
Permalink:  ../56399791-7fb6-0a80-8d24-3428fcdd96d3@redhat.com/
Also on:    postgresql.org/message-id/56399791-7fb6-0a80-8d24-3428fcdd96d3@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: <56399791-7fb6-0a80-8d24-3428fcdd96d3@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