Re: Multithreaded query onto 4 postgresql instances

From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: Alessandro Candini <candini(at)meeo(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Multithreaded query onto 4 postgresql instances
Date: 2011-02-15 18:32:13
Message-ID: D1B48DFC-98D2-4C1C-A874-D811D85D13EA@solfertje.student.utwente.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 or less:
>
> 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 the step from simple functions to SRF's is too large for you, create a few sample-functions to learn how the intermediary steps 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 alter already 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!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alpha Beta 2011-02-15 18:39:59 Best RDB book to suggest
Previous Message Carlos Mennens 2011-02-15 17:52:55 Re: PostgreSQL ODBC Driver Help