pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Svetlin Manavski <svetlin.manavski@gmail.com>
To: Greg Spiegelberg <gspiegelberg@gmail.com>
Cc: Marinos Yannikos <mjy@geizhals.at>
Cc: pgsql-performance@postgresql.org
Subject: Re: is parallel union all possible over dblink?
Date: Thu, 30 Jun 2011 10:02:07 +0100
Message-ID: <BANLkTim7gViO93cRhBPCjd-+n96mTTrORw@mail.gmail.com> (raw)
In-Reply-To: <BANLkTin_CFVj24_XX=+o_gZKtTCuqgENQg@mail.gmail.com>
References: <BANLkTimwCWg6LGavaNU3YMJNcBiWppX9UQ@mail.gmail.com>
	<op.vxuoogblkhmbxg@klump-pc.ghoffice>
	<BANLkTin_CFVj24_XX=+o_gZKtTCuqgENQg@mail.gmail.com>

I am now a bit puzzled after the initial satisfaction by Marinos' reply.

1. what do you mean exactly by "to ensure your UNION succeeds". The dblink
docs do not mention anything about issues using directly  the suggested
dblink_send_query() + dblink_get_results(). What problems should I expect in
using them as suggested by Marinos?

2. If I understand correctly your method, it is not applicable from inside a
stored procedure, is it? I need to keep all the business logic within
PostgreSQL and provide just a clean interface to a simple GUI layer

3. Unfortunately GridSQL and Pgpool-II do not seem mature and stable
products to be used in commercial software. Neither one provides clear
documentation. GridSQL has been discontinued and it is not clear what kind
of future it will have. I have not tried GridSQL but I did try Pgpool-II. It
is disappointing that it may stop working correctly even just because of the
way you write the query (e.g. using uppercase in a field or using named
field in group by, ecc.). Even worse, when it does not recognize something
in the parallel query, it just provides incorrect result (from only the
local DB) rather than raising an exception. So I guess Pgpool-II in its
current state is good only for very simple applications, which are not
supposed to be reliable at all.

Thank you,
Svetlin Manavski


On Wed, Jun 29, 2011 at 8:14 PM, Greg Spiegelberg <gspiegelberg@gmail.com>wrote:

>
> This does work however you'll need to add a little more to it to ensure
> your UNION succeeds.  In pseudo...
>
> connection #1:
> CREATE TABLE target_1 ...
> BEGIN;
> LOCK TABLE target_1 IN ACCESS EXCLUSIVE MODE;
> INSERT INTO target_1 SELECT ...
> COMMIT;
>
> connection #2:
> CREATE TABLE target_2 ...
> BEGIN;
> LOCK TABLE target_2 IN ACCESS EXCLUSIVE MODE;
> INSERT INTO target_2 SELECT ...
> COMMIT;
>
> connection #3:
> SELECT * FROM target_1 UNION SELECT * FROM target_2;
>
> Connections 1 and 2 can be done in simultaneously and after both have
> reached the LOCK statement then the SELECT on connection 3 can be executed.
>  Same fundamentals if all three connections are to different databases and
> connection 3 uses dblink to pull the data.
>
> Another alternative is to use GridSQL.  I haven't used it myself but seen
> it in action on a large install with 4 backend databases.  Pretty slick.
>
> Greg
>
>

view thread (6+ messages)  latest in thread

Message-ID: <BANLkTim7gViO93cRhBPCjd-+n96mTTrORw@mail.gmail.com>
Permalink:  ../BANLkTim7gViO93cRhBPCjd-+n96mTTrORw@mail.gmail.com/
Also on:    postgresql.org/message-id/BANLkTim7gViO93cRhBPCjd-+n96mTTrORw@mail.gmail.com

 · 

reply

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, gspiegelberg@gmail.com, mjy@geizhals.at
  Subject: Re: is parallel union all possible over dblink?
  In-Reply-To: <BANLkTim7gViO93cRhBPCjd-+n96mTTrORw@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