Re: Re: Allow replacement of bloated primary key indexes without foreign key rebuilds

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Re: Allow replacement of bloated primary key indexes without foreign key rebuilds
Дата
Msg-id 21013.1341931443@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Allow replacement of bloated primary key indexes without foreign key rebuilds  (Greg Stark <stark@mit.edu>)
Ответы Re: Re: Allow replacement of bloated primary key indexes without foreign key rebuilds  (Greg Stark <stark@mit.edu>)
Re: Re: Allow replacement of bloated primary key indexes without foreign key rebuilds  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: Re: Allow replacement of bloated primary key indexes without foreign key rebuilds  (Gurjeet Singh <singh.gurjeet@gmail.com>)
Список pgsql-hackers
Greg Stark <stark@mit.edu> writes:
> On Sat, Jul 7, 2012 at 4:53 AM, Gurjeet Singh <singh.gurjeet@gmail.com> wrote:
>> All we need to do is allow swapping of pg_class.relfilenode of two indexes.

> Fwiw I don't like swapping relfilenodes on indexes the user created.
> REINDEX currently does this but it's a bit of a hack and only works
> because reindex carefully builds the new index with exactly the same
> definition as the old one.

Yes.  The swap-relfilenodes operation would have to carefully check that
the index definitions were exactly equivalent, and there would be a
constant risk for bugs of omission if that code weren't taught about
any new index properties we invent.

> The problem you describe is one of constraints and dependencies and
> not one of indexes. It seems what you really want is a way to alter
> foreign key dependencies to depend on a new index. Either an explicit
> command that lets you set the new dependency or what seems even better
> would be to have DROP INDEX check any dependent objects to see if
> there's another index that can satisfy them and change their
> dependency.

Either of these have exactly the same issue, namely their correctness
depends on determining if two indexes have identical properties.

All of these things seem like ugly, hard-to-use kluges anyway (the
make-sure-the-indexes-match business is just as much of a PITA for the
DBA as it is for the system).  What we really want is REINDEX
CONCURRENTLY.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Synchronous Standalone Master Redoux
Следующее
От: Dimitri Fontaine
Дата:
Сообщение: Re: expression evaluation with expected datatypes