From: Jesper Pedersen <jesper.pedersen@redhat.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Maksim Milyutin <milyutinma@gmail.com>
Subject: Re: [HACKERS] Proposal: Local indexes for partitioned table
Date: Tue, 14 Nov 2017 14:07:20 -0500
Message-ID: <3d57d8ad-e76d-f0cf-0c42-d1202c643dba@redhat.com> (raw)
In-Reply-To: <20171114174946.m7ihrns7jxzrsavz@alvherre.pgsql>
References: <20171114174946.m7ihrns7jxzrsavz@alvherre.pgsql>
Hi,
On 11/14/2017 12:49 PM, Alvaro Herrera wrote:
>> Thanks, pushed.
>
> Here's the remaining bits, rebased.
>
First of all, thanks for working on this.
I have been looking at the "CREATE INDEX ... ONLY" syntax, and I think
it could cause some confusion due to the "Note" described in
create_index.sgml.
An alternative, maybe crazy, could be to treat a partitioned index as
one; e.g. all operations are on the definition. That way ONLY, ATTACH
and DETACH could be eliminated. Once a partition is detached any
partitioned indexes would be marked as a normal index, and a partition
could only be attached if it had indexes satisfying all partition index
definitions. Bloat could be handled by swapping the index as suggested
by David [1]. It would be less flexible, but people always have the
option to define indexes directly on the partitions.
Some comments.
0004's alter_index.sgml are missing the "PARTITION" keyword for both the
ATTACH and DETACH commands.
A small thing, for
-- 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);
-- test.sql --
I would expect that the index names were 'test_p00_idx_test_a' and
'test_p01_idx_test_a'.
psql completion for "CREATE INDEX blah ON tes<TAB>" only lists the child
tables. Completion for the ALTER INDEX commands is missing.
[1]
https://www.postgresql.org/message-id/CAKJS1f_Wf%3DM06o8iQi72SxN%2BZpLV4c0CwYoN5xYVY4aWWX-jBQ%40mail...
Best regards,
Jesper
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, simon@2ndquadrant.com, robertmhaas@gmail.com, milyutinma@gmail.com
Subject: Re: [HACKERS] Proposal: Local indexes for partitioned table
In-Reply-To: <3d57d8ad-e76d-f0cf-0c42-d1202c643dba@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