Re: Building multiple indexes on one table.

Поиск
Список
Период
Сортировка
Искать
От
Claudio Freire
Тема
Re: Building multiple indexes on one table.
Дата
Msg-id
CAGTBQpZUJwhmQJVswdpUG44szQdiSf2a0ECgJGej18_mOKXmWQ@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Building multiple indexes on one table. Chris Ruprecht <chris@cdrbill.com>
Re: Building multiple indexes on one table. Claudio Freire <klaussfreire@gmail.com>
Re: Building multiple indexes on one table. Marc Mamin <M.Mamin@intershop.de>
Re: Building multiple indexes on one table. Claudio Freire <klaussfreire@gmail.com>
Re: Building multiple indexes on one table. Felipe Santos <felipepts@gmail.com>
On Thu, Jul 17, 2014 at 7:47 PM, Chris Ruprecht  wrote:
> Is there any way that I can build multiple indexes on one table without having to scan the table multiple times? For small tables, that's probably not an issue, but if I have a 500 GB table that I need to create 6 indexes on, I don't want to read that table 6 times.
> Nothing I could find in the manual other than reindex, but that's not helping, since it only rebuilds indexes that are already there and I don't know if that reads the table once or multiple times. If I could create indexes inactive and then run reindex, which then reads the table once, I would have a solution. But that doesn't seem to exist either.

Just build them with separate but concurrent connections, and the
scans will be synchronized so it will be only one.

Btw, reindex rebuilds one index at a time, so what I do is issue
separate reindex for each index in parallel, to avoid the repeated
scans as well.

Just make sure you've got the I/O and CPU capacity for it (you'll be
writing many indexes at once, so there is a lot of I/O).

В списке pgsql-performance по дате отправления
От: Chris Ruprecht
Дата:
От: Benjamin Dugast
Дата:
FAQ