Re: About PG-Pool Load balance configuration

From: Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp>
To: "chongin119(at)icloud(dot)com" <chongin119(at)icloud(dot)com>
Cc: "pgpool-general(at)lists(dot)postgresql(dot)org" <pgpool-general(at)lists(dot)postgresql(dot)org>
Subject: Re: About PG-Pool Load balance configuration
Date: 2025-10-28 07:55:49
Message-ID: TYYP286MB29312718F3957A43EC83677E94FDA@TYYP286MB2931.JPNP286.PROD.OUTLOOK.COM
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-general

You can exclude specific SQL statements from load balancing by using either the allow_sql_comment or primary_routing_query_pattern_list settings, in a similar way to the /*NO LOAD BALANCE*/ comment.

When allow_sql_comment is set to off, you can disable load balancing for a particular SQL statement by adding any comment at the beginning of the query.
For example:
/* any comment */ SELECT 1;

Also, you can specify SQL patterns that should not be load-balanced by using the primary_routing_query_pattern_list parameter.
For example:
primary_routing_query_pattern_list = 'SELECT 1\;'

For more details on how to configure these options, please refer to the official documentation: https://www.pgpool.net/docs/45/ja/html/runtime-config-load-balancing.html

Taiki Koshino<koshino(at)sraoss(dot)co(dot)jp>
SRA OSS K.K.
TEL: 03-5979-2701 FAX: 03-5979-2702
URL: https://www.sraoss.co.jp/

________________________________
差出人: chongin119(at)icloud(dot)com <chongin119(at)icloud(dot)com>
送信: 2025 年 10 月 15 日 (水曜日) 10:24
宛先: pgpool-general(at)lists(dot)postgresql(dot)org <pgpool-general(at)lists(dot)postgresql(dot)org>
件名: About PG-Pool Load balance configuration

Dear pgpool-general,

I have already set up a cluster(base streaming replication) with three pgpool service(4.5.2) and three postgres nodes(17.5.2).

Also, I enable load balance mode because we need this.

In our config file of pgpool, I also set “statement_level_load_balance” to on and “allow_sql_comments” to off.

Now, I have some queries that I want to control whether I use load balance mode or not.

After I checked the documentation, I find out that I can add “/*NO LOAD BALANCE*/” before select query only in pgpool 4.2.

But can not add this comment before select query in pgpool 4.5.

https://www.pgpool.net/docs/42/en/html/runtime-config-load-balancing.html (have /*NO LOAD BALANCE*/)

https://www.pgpool.net/docs/45/en/html/runtime-config-load-balancing.html (do not have /*NO LOAD BALANCE*/))

Do you have any idea about this?

Best Regards,

Terence

In response to

Browse pgpool-general by date

  From Date Subject
Next Message Tatsuo Ishii 2025-10-28 23:39:54 Re: [pgpool-general: 9486] Retiring slony mode
Previous Message Tatsuo Ishii 2025-10-27 04:20:30 Re: [pgpool-general: 9486] Retiring slony mode