Re: Creating indexes in the background

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Creating indexes in the background
Дата
Msg-id 20121029143246.GF12961@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Creating indexes in the background  (David Lee <davidomundo@gmail.com>)
Ответы Re: Creating indexes in the background
Список pgsql-hackers
David Lee escribió:
> Thanks for all the responses.
>
> I forgot to ask in my initial post: If not already available, is background indexing a viable feature request? (This
waswhy I sent to pgsql-hackers). 
>
> My use case is a multi-tenant CMS where indexes can be created by a web front-end. Since web requests should return
quickly,it would be optimal to fire off an index creation and return immediately. Since this is not available natively
inpostgresql, I have to have a separate worker process that handles long-running connections, and manage communication
betweenthe worker process and the web server process. 

I think the easiest way to handle this would be to have the web frontend
record the request to create the index somewhere, and a separate process
(maybe one doing LISTEN permanently) does the actual creation.

> Since I've mentioned my use case, I might as well mention another issue I stumbled across, which is that concurrent
indexcreation cannot happen from within trigger functions. I'm able to non-concurrently create indexes from within
triggerfunctions. Why is there this disparity? 

Because concurrent index creation needs to open and commit transactions
underneath, which regular index creation does not.  Functions cannot run
across transaction boundaries.

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



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Performance Improvement by reducing WAL for Update Operation
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: Performance Improvement by reducing WAL for Update Operation