Re: [HACKERS] Proposal: Local indexes for partitioned table

Поиск
Список
Период
Сортировка
Искать
От
Robert Haas
Тема
Re: [HACKERS] Proposal: Local indexes for partitioned table
Дата
Msg-id
CA+TgmoYu5qHs8ku0nNkmBeq8cfQwb5=-N3-aOggHNgo_D5q15Q@mail.gmail.com
Ответ на
Список
Дерево обсуждения
[HACKERS] Proposal: Local indexes for partitioned table Maksim Milyutin <m.milyutin@postgrespro.ru>
Re: Proposal: Local indexes for partitioned table Maksim Milyutin <m.milyutin@postgrespro.ru>
Re: [HACKERS] Proposal: Local indexes for partitioned table Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Maksim Milyutin <m.milyutin@postgrespro.ru>
Re: [HACKERS] Proposal: Local indexes for partitioned table Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: [HACKERS] Proposal: Local indexes for partitioned table Maksim Milyutin <m.milyutin@postgrespro.ru>
Re: [HACKERS] Proposal: Local indexes for partitioned table Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Maksim Milyutin <m.milyutin@postgrespro.ru>
Re: [HACKERS] Proposal: Local indexes for partitioned table Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Maksim Milyutin <milyutinma@gmail.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Greg Stark <stark@mit.edu>
Re: [HACKERS] Proposal: Local indexes for partitioned table Maksim Milyutin <m.milyutin@postgrespro.ru>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table Maksim Milyutin <milyutinma@gmail.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table Simon Riggs <simon@2ndquadrant.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table Jesper Pedersen <jesper.pedersen@redhat.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Simon Riggs <simon@2ndquadrant.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table David Rowley <david.rowley@2ndquadrant.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table David Rowley <david.rowley@2ndquadrant.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: [HACKERS] Proposal: Local indexes for partitioned table Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Maksim Milyutin <milyutinma@gmail.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table David Rowley <david.rowley@2ndquadrant.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table David Rowley <david.rowley@2ndquadrant.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table David Rowley <david.rowley@2ndquadrant.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] Proposal: Local indexes for partitioned table David Rowley <david.rowley@2ndquadrant.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Proposal: Local indexes for partitioned table Maksim Milyutin <m.milyutin@postgrespro.ru>
On Wed, Mar 1, 2017 at 4:23 PM, Maksim Milyutin
 wrote:
> As I've understood from thread [1] the main issue of creating local indexes
> for partitions is supporting REINDEX and DROP INDEX operations on parent
> partitioned tables. Furthermore Robert Haas mentioned the problem of
> creating index on key that is represented in partitions with single value
> (or primitive interval) [1] i.e. under the list-partitioning or
> range-partitioning with unit interval.
>
> I would like to propose the following solution:
>
> 1. Create index for hierarchy of partitioned tables and partitions
> recursively. Don't create relfilenode for indexes on parents, only entries
> in catalog (much like the partitioned table's storage elimination in [2]).
> Abstract index for partitioned tables is only for the reference on indexes
> of child tables to perform REINDEX and DROP INDEX operations.
>
> 2. Specify created indexes in pg_depend table so that indexes of child
> tables depend on corresponding indexes of parent tables with type of
> dependency DEPENDENCY_NORMAL so that index could be removed separately for
> partitions and recursively/separately for partitioned tables.
>
> 3. REINDEX on index of partitioned table would perform this operation on
> existing indexes of corresponding partitions. In this case it is necessary
> to consider such operations as REINDEX SCHEMA | DATABASE | SYSTEM so that
> partitions' indexes wouldn't be re-indexed multiple times in a row.
>
> Any thoughts?

Sounds generally good.  One thing to keep in mind is that - in this
system - a UNIQUE index on the parent doesn't actually guarantee
uniqueness across the whole partitioning hierarchy unless it so
happens that the index columns or expressions are the same as the
partitioning columns or expressions.  That's a little a
counterintuitive, and people have already been complaining that a
partitioned table + partitions doesn't look enough like a plain table.
However, I'm not sure there's a better alternative, because somebody
might want partition-wise unique indexes even though that doesn't
guarantee global uniqueness.  So I think if someday we have global
indexes, then we can plan to use some other syntax for that, like
CREATE GLOBAL [ UNIQUE ] INDEX.

But, of course, that's just my opinion.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


В списке pgsql-hackers по дате отправления
От: Stas Kelvich
Дата:
От: Yugo Nagata
Дата:
FAQ