Re: [HACKERS] REINDEX CONCURRENTLY 2.0

Поиск
Список
Период
Сортировка
Искать
От
Andreas Karlsson
Тема
Re: [HACKERS] REINDEX CONCURRENTLY 2.0
Дата
Msg-id
025c1e3d-1586-c678-922c-c01e12bb013e@proxel.se
Ответ на
Список
Дерево обсуждения
REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Andres Freund <andres@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Andres Freund <andres@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Alvaro Herrera <alvherre@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter_e@gmx.net>
Re: REINDEX CONCURRENTLY 2.0 Jim Nasby <jim@nasby.net>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Andres Freund <andres@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: REINDEX CONCURRENTLY 2.0 Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Jeff Janes <jeff.janes@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter_e@gmx.net>
Re: REINDEX CONCURRENTLY 2.0 Robert Haas <robertmhaas@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Robert Haas <robertmhaas@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Andres Freund <andres@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Robert Haas <robertmhaas@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Andres Freund <andres@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Alvaro Herrera <alvherre@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter_e@gmx.net>
Re: REINDEX CONCURRENTLY 2.0 Andres Freund <andres@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: REINDEX CONCURRENTLY 2.0 Andres Freund <andres@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Oskari Saarenmaa <os@ohmu.fi>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Robert Haas <robertmhaas@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Andres Freund <andres@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Robert Haas <robertmhaas@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Andres Freund <andres@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Bruce Momjian <bruce@momjian.us>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Bruce Momjian <bruce@momjian.us>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Jim Nasby <Jim.Nasby@BlueTreble.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andres Freund <andres@anarazel.de>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andres Freund <andres@anarazel.de>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Jim Nasby <jim.nasby@openscg.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andres Freund <andres@anarazel.de>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Thomas Munro <thomas.munro@enterprisedb.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Thomas Munro <thomas.munro@enterprisedb.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Peter Geoghegan <pg@bowt.ie>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: REINDEX CONCURRENTLY 2.0 Michael Banck <michael.banck@credativ.de>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Craig Ringer <craig@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Stephen Frost <sfrost@snowman.net>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Sergei Kornilov <sk@zsrv.org>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Sergei Kornilov <sk@zsrv.org>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Stephen Frost <sfrost@snowman.net>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Stephen Frost <sfrost@snowman.net>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Stephen Frost <sfrost@snowman.net>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Stephen Frost <sfrost@snowman.net>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andres Freund <andres@anarazel.de>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Sergei Kornilov <sk@zsrv.org>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Vik Fearing <vik.fearing@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Vik Fearing <vik.fearing@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Sergei Kornilov <sk@zsrv.org>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andres Freund <andres@anarazel.de>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Pavel Stehule <pavel.stehule@gmail.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Stephen Frost <sfrost@snowman.net>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andres Freund <andres@anarazel.de>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Sergei Kornilov <sk@zsrv.org>
Re: REINDEX CONCURRENTLY 2.0 Sergei Kornilov <sk@zsrv.org>
Re: REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Banck <michael.banck@credativ.de>
Re: REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Sergei Kornilov <sk@zsrv.org>
Re: REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: REINDEX CONCURRENTLY 2.0 Sergei Kornilov <sk@zsrv.org>
Re: REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Sergei Kornilov <sk@zsrv.org>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
RE: REINDEX CONCURRENTLY 2.0 "Shinoda, Noriyoshi (PN Japan A&PS Delivery)"<noriyoshi.shinoda@hpe.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Robert Treat <rob@xzilla.net>
Re: REINDEX CONCURRENTLY 2.0 Andres Freund <andres@anarazel.de>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: REINDEX CONCURRENTLY 2.0 "Bossart, Nathan" <bossartn@amazon.com>
Re: REINDEX CONCURRENTLY 2.0 Justin Pryzby <pryzby@telsasoft.com>
Re: REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: REINDEX CONCURRENTLY 2.0 Alvaro Herrera <alvherre@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: REINDEX CONCURRENTLY 2.0 ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: REINDEX CONCURRENTLY 2.0 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Andreas Karlsson <andreas@proxel.se>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Michael Paquier <michael@paquier.xyz>
Re: [HACKERS] REINDEX CONCURRENTLY 2.0 Pavel Stehule <pavel.stehule@gmail.com>
On 03/08/2017 03:48 AM, Robert Haas wrote:
> On Sun, Mar 5, 2017 at 7:13 PM, Andreas Karlsson  wrote:
>> And I would argue that his feature is useful for quite many, based on my
>> experience running a semi-large database. Index bloat happens and without
>> REINDEX CONCURRENTLY it can be really annoying to solve, especially for
>> primary keys. Certainly more people have problems with index bloat than the
>> number of people who store index oids in their database.
>
> Yeah, but that's not the only wart, I think.

The only two potential issues I see with the patch are:

1) That the index oid changes visibly to external users.

2) That the code for moving the dependencies will need to be updated 
when adding new things which refer to an index oid.

Given how useful I find REINDEX CONCURRENTLY I think these warts are 
worth it given that the impact is quite limited. I am of course biased 
since if I did not believe this I would not pursue this solution in the 
first place.

> For example, I believe
> (haven't looked at this patch series in a while) that the patch takes
> a lock and later escalates the lock level.  If so, that could lead to
> doing a lot of work to build the index and then getting killed by the
> deadlock detector.

This version of the patch no longer does that. For my use case 
escalating the lock would make this patch much less interesting. The 
highest lock level taken is the same one as the initial one (SHARE 
UPDATE EXCLUSIVE). The current patch does on a high level (very 
simplified) this:

1. CREATE INDEX CONCURRENTLY ind_new;
2. Atomically move all dependencies from ind to ind_new, rename ind to 
ind_old, and rename ind_new to ind.
3. DROP INDEX CONCURRENTLY ind_old;

The actual implementation is a bit more complicated in reality, but no 
part escalates the lock level over what would be required by the steps 
for creating and dropping indexes concurrently

> Also, if by any chance you think (or use any
> software that thinks) that OIDs for system objects are a stable
> identifier, this will be the first case where that ceases to be true.
> If the system is shut down or crashes or the session is killed, you'll
> be left with stray objects with names that you've never typed into the
> system.  I'm sure you're going to say "don't worry, none of that is
> any big deal" and maybe you're right.

Hm, I cannot think of any real life scenario where this will be an issue 
based on my personal experience with PostgreSQL, but if you can think of 
one please provide it. I will try to ponder some more on this myself.

Andreas


В списке pgsql-hackers по дате отправления
От: Mark Dilger
Дата:
От: Pavel Stehule
Дата:
FAQ