Re: pg_background contrib module proposal

Поиск
Список
Период
Сортировка
От Andrew Borodin
Тема Re: pg_background contrib module proposal
Дата
Msg-id CAJEAwVGcXtfdUYf5aHA_60Envgbe=QEPqYFYdTL5YtjDbKPKGA@mail.gmail.com
обсуждение исходный текст
Ответ на pg_background contrib module proposal  (amul sul <sulamul@gmail.com>)
Ответы Re: [HACKERS] pg_background contrib module proposal  (Andrew Borodin <borodin@octonica.com>)
Список pgsql-hackers
This is simply wonderful!
Finaly, I can implement my favorite sleepsort in postgres:

create table input as select round(random()*20) x from generate_series(1,5,1);
create table output(place int,value int);
create sequence s start 1;
create table handles as select pg_background_launch('select
pg_sleep('||x||'); insert into output values
(nextval(''s''),'||x||');') h from input;
select (select * from pg_background_result(h) as (x text) limit 1) from handles;
select * from output;

Works like a charm. It has perfrect running time O(1) where n is
number of items to sort, but it cannot sort more than
max_worker_processes-1.
Next step of user cuncurrency mechanics is future indexes (indexes
under cunstruction are taken into plans, query is executed when index
is actualy constructed) and promised tables (query waits untial there
is actually data in the table).


I like the idea and implementation and I'm planning to post review by
the end of december.
Right now I have just one useful idea: I do not see comfortable way to
check up state of task (finished\failed) without possibility of haning
for long or catching fire.

Best regards, Andrey Borodin.



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

Предыдущее
От: Erik Rijkers
Дата:
Сообщение: Re: Declarative partitioning - another take
Следующее
От: Amit Langote
Дата:
Сообщение: Re: Declarative partitioning - another take