[Pgpool-general] [pgpool-general] load balancing for dummies

Jaime Casanova jcasanov at systemguards.com.ec
Tue Dec 15 18:08:26 UTC 2009


On Mon, Dec 14, 2009 at 4:25 PM, Jaume Sabater <jsabater at gmail.com> wrote:
>
> That is unnecessary as pgpool-II already checks for volatile
> components of the query and acts according to it,

really?

the manual says (and no mention at all about volatile functions):
"""
For the query to be load balanced, all the requirements below must be met:

    * PostgreSQL version 7.4 or later
    * the query must not be in an explicitly declared transaction
(i.e. not in a BEGIN ~ END block)
    * it's not SELECT nextval or SELECT setval
    * it's not SELECT INTO
    * it's not SELECT FOR UPDATE nor FOR SHARE
    * start with "SELECT" (ignore_leading_white_space = true will
ignore leading white space) or one of COPY TO STDOUT, EXPLAIN, EXPLAIN
ANALYZE SELECT...
"""

> I suggest that you read the docs and start
> playing with the new version 2.3:
>

i read part of the code of the new version and can't find where we act
"accordingly" when we found a volatile function.
for example the function  is_select_query() is checking for the above
conditions (still i don't understand all the code, look [1] for an
example) and when we ask several places IsA(node, FuncCall) we only
ask for function names (ie: functions already existing an known for
pgpool) we should be asking for the volatily property instead


[1]  return (*sql == 's' || *sql == 'S' || *sql == '(' ||
                *sql == 'w' || *sql == 'W' || *sql == 't' || *sql == 'T');

-- 
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157


More information about the Pgpool-general mailing list