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

Поиск
Список
Период
Сортировка
Искать
От
Alvaro Herrera
Тема
Re: [HACKERS] Proposal: Local indexes for partitioned table
Дата
Msg-id
20171114120946.ovsswdfl34ob6ag2@alvherre.pgsql
Ответ на
Список
Дерево обсуждения
[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>
Thanks for looking.

David Rowley wrote:

> So, if that works for ATTACH, then can't pg_dump just
> create each of the partition's indexes first, then create the
> partitioned table's partition index, and that command would just go
> through checking each partition similar to how ATTACH would work.

That was my first thought too (and I actually implemented it like this
before the current approach).  But there's a small problem: if a
partition exists which *doesn't* have the index, restoring things this
way would create the index in that partition too, which is unwanted
because the end state is different to what was in the dumped database.
This is because the command is either recursive (finds a matching index
and attachs it, or create a new one) or not recursive (does not look at
children at all).  But a command that is partially recursive (attach any
matching index, but do nothing if none exists) would be way too
confusing, ISTM.

Another small issue is that each partition might have two matching
indexes, maybe because one was in the process of being removed; how
would CREATE INDEX at restore time know which one to attach?  It could
do so by choosing arbitrarily, but that doesn't seem reliable.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

В списке pgsql-hackers по дате отправления
От: Magnus Hagander
Дата:
От: David Rowley
Дата:
FAQ