From: Svetlin Manavski <svetlin.manavski@gmail.com>
To: pgsql-performance@postgresql.org
Subject: is parallel union all possible over dblink?
Date: Wed, 29 Jun 2011 12:55:58 +0100
Message-ID: <BANLkTimwCWg6LGavaNU3YMJNcBiWppX9UQ@mail.gmail.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: svetlin.manavski@gmail.com
Subject: Re: is parallel union all possible over dblink?
In-Reply-To: <BANLkTimwCWg6LGavaNU3YMJNcBiWppX9UQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox