pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hasnul Fadhly bin Hasan <hasnulfadhly.h@mimos.my>
To: pgsql-performance@postgresql.org
Subject: Trying to create multi db query in one large queries
Date: Tue, 14 Dec 2004 09:44:56 +0800
Message-ID: <41BE4598.2040708@mimos.my> (raw)

Hi,

I am not sure if this is the place to ask this question, but since the 
question is trying to improve the performance.. i guess i am not that 
far off.

My question is if there is a query design that would query multiple 
server simultaneously.. would that improve the performance?

To make it clear.. let's say we have 3 db servers.  1 server is just 
designed to take the queries while the other 2 server is the ones that 
actually
holds the data.  let's say we have a query of 'select * from 
customer_data' and we change it to
select * from
(
dblink('db1','select * from customer_data where timestamp between 
timestamp \'01-01-2004\' and timestamp \'06-30-2004\'')
union
dblink('db2','select * from customer_data where timestamp between 
timestamp \'01-07-2004\' and timestamp \'12-31-2004\'')
)

Would the subquery above be done simultaneously by postgres before doing 
the end query? or would it just execute one at a time?

If it does execute simultaneously.. it's possible to create code to 
convert normal queries to distributed queries and requesting data from 
multiple
database to improve performance.  This would be advantageous for large 
amount of data.

Thanks,

Hasnul





view thread (5+ messages)  latest in thread

Message-ID: <41BE4598.2040708@mimos.my>
Permalink:  ../41BE4598.2040708@mimos.my/
Also on:    postgresql.org/message-id/41BE4598.2040708@mimos.my

 · 

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: hasnulfadhly.h@mimos.my
  Subject: Re: Trying to create multi db query in one large queries
  In-Reply-To: <41BE4598.2040708@mimos.my>

* 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