[Pgpool-general] Load balancing read-write functions

Paul Robert Marino prmarino1 at gmail.com
Sun Jun 1 01:07:49 UTC 2008


Think of pgpool as a smart proxy. While it can uderstand that an insert 
update or replace is a write function that must go only to a master node 
it has no real understanding of any rules functions or trigers in your 
database. So it has no way of figuring out that your query is any 
different then a standard select without you telling it.
On Fri, 30 May 2008 2:47 am, Yoshiyuki Asaba wrote:
> Hi,
>
> From: Nelson Correia <nelsonwc7 at hotmail.com>
> Subject: [Pgpool-general] Load balancing read-write functions
> Date: Thu, 29 May 2008 10:00:54 +0000
>
>>  Hi,I have a scenario   where I want to use Slony for master-slave
>>  replication and pgpool for load-balancing and where I have many
>>  functions with write commands. When using these functions I issue a
>>  command like "select * from somefunction(1, 'xpto')" and
>>  'somefunction' will do several queries, being one of them an
>>  insert/update. How will pgpool load-balance this kind of queries? Is
>>  it able to see that it's not a read-only command and will send the
>>  command always only to the master? More generically, how did pgpool
>>  deal with functions and triggers?Thanks,Nelson
>
> If you would like to send a SELECT query to a master node,
> add "/* NO LOADBALANCE */" at the beginning of the query.
>
> SELECT * from somefunction(1, 'xpto');
>
> -->
>
> /* NO LOADBALANCE */ SELECT * from somefunction(1, 'xpto');
>
> Regard,
> --
> Yoshiyuki Asaba
> y-asaba at sraoss.co.jp
> _______________________________________________
> Pgpool-general mailing list
> Pgpool-general at pgfoundry.org
> http://pgfoundry.org/mailman/listinfo/pgpool-general
___________________________________________
The average person does a lot of work in the name of laziness!
Save youre self the effort by doing it right the first time.
Do it with free speech software.


More information about the Pgpool-general mailing list