is parallel union all possible over dblink?

Поиск
Список
Период
Сортировка
От Svetlin Manavski
Тема is parallel union all possible over dblink?
Дата
Msg-id BANLkTimwCWg6LGavaNU3YMJNcBiWppX9UQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: is parallel union all possible over dblink?  ("Marinos Yannikos" <mjy@geizhals.at>)
Список pgsql-performance
Hi all,
I am running PostgreSQL 9.0 on a number of nodes in an application level cluster (there is different data on different machines). Currently a PL/pgSQL function generates automatically aggregation queries like the following: 

(select * from appqosfe.F_total_utilization(1306918800000000000::INT8, NULL, 60000000000::INT8, NULL))
UNION ALL
(SELECT * from dblink('remote1','select * from appqosfe.F_total_utilization(1306918800000000000::INT8, NULL, 60000000000::INT8, NULL)') as T1(detectroid numeric, timegroup numeric, numbytes numeric, numpackets numeric))
order by timegroup asc

The above example supposes that only 2 nodes are active (one local and one remote). Here I can clearly see that the remote sub-query starts only when the local one is completed so the total time grows linearly with the number of nodes.

Question: Is there a way to get the same result from within a PL/pgSQL function but running all the sub-queries in parallel? In case it is not directly available, which one would be the simplest way to implement it in my application? (I am very keen to avoid the obvious solution of an additional multi-threaded layer which would do it out of the RDBMS)

Thank you,
Svetlin Manavski

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: change sample size for statistics
Следующее
От: "Marinos Yannikos"
Дата:
Сообщение: Re: is parallel union all possible over dblink?