Re: Will partial index creation use existing index?

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Will partial index creation use existing index?
Дата
Msg-id 87abtl7fd5.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Will partial index creation use existing index?  (Jim Nasby <decibel@decibel.org>)
Ответы Re: Will partial index creation use existing index?  (Ron Johnson <ron.l.johnson@cox.net>)
Список pgsql-general
"Jim Nasby" <decibel@decibel.org> writes:

> Check the source code, but I'm 99% certain that CREATE INDEX doesn't consider
> any existing indexes. While what you're describing is  theoretically possible,
> it's not a very common use-case, so it's  rather unlikely to get worked on
> unless other folks show up with  *real life* examples of where this would be
> useful.

Yeah we don't support this feature. It is something useful that I even though
of doing a while back. I think it's on the TODO somewhere.

The main use case for it is actually REINDEX. Since you already have an index
which contains precisely the records you want to index and already in order
too.

The main disadvantage is that it's not clear when it would actually be faster.
Generally index scans are slower than reading the whole table and sorting.
Probably it would have to run an SPI query to use the planner to find the best
way to get the rows it wants.

Another problem is that presumably you're reindexing because the existing
index *isn't* in such good shape. You may even be doing it because the
existing index is corrupt.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com


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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Silent Uninstall of Postgres
Следующее
От: Robert Landrum
Дата:
Сообщение: GiST Support in 8.1