Re: Multithreaded query onto 4 postgresql instances - Mailing list pgsql-general

From Alban Hertroys
Subject Re: Multithreaded query onto 4 postgresql instances
Date
Msg-id D1B48DFC-98D2-4C1C-A874-D811D85D13EA@solfertje.student.utwente.nl
Whole thread Raw
In response to Re: Multithreaded query onto 4 postgresql instances  (Alessandro Candini <candini@meeo.it>)
Responses Re: Multithreaded query onto 4 postgresql instances  (Alessandro Candini <candini@meeo.it>)
List pgsql-general
On 15 Feb 2011, at 9:32, Alessandro Candini wrote:

>> Is that a single query on that one DB compared to 4 queries on 4 DB's? How does a single DB with 4 parallel queries
perform?I'd expect that to win from 4 DB's, due to the overhead those extra DB instances are generating. 
>
> Maybe my configuration and test is not clear

It is clear. I gave you another suggestion for something to try instead.

> Splitted instances:
> 600 millions of records in total splitted into 4 postgresql instances (port 5433, 5434, 5435, 5436), let's say more
orless: 
>
> 5433 ---> 150 millions of records
> 5434 ---> 150 millions of records
> 5435 ---> 150 millions of records
> 5436 ---> 150 millions of records

Try the above on a single DB using 4 threads. It will very probably perform better.
To use your example:
5432 ---> 150 million records
5432 ---> 150 million records
5432 ---> 150 million records
5432 ---> 150 million records

>> Did you read all the way to section 35.9.10? That explains how to create SRF's like yours, including examples. If
thestep from simple functions to SRF's is too large for you, create a few sample-functions to learn how the
intermediarysteps work. We can't upload the info to your brain, after all - you'll have to do the learning part by
yourself.
>>
> Do you think is a good idea continue using libpq or should I abandon them and focus on postgresql documentation
examples?

To learn how to write functions like these? Best to use a simple case so it's clear what's going on. If you try to
alteralready complicated code for that purpose you'll probably just get more confused. 

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.


!DSPAM:737,4d5ac6b711731056715104!



pgsql-general by date:

Previous
From: Carlos Mennens
Date:
Subject: Re: PostgreSQL ODBC Driver Help
Next
From: Alpha Beta
Date:
Subject: Best RDB book to suggest