[pgpool-hackers: 2801] Re: [New feature] Enable specifying SQL patterns lists that should not be load-balanced.

Tatsuo Ishii ishii at sraoss.co.jp
Mon May 14 12:59:00 JST 2018


Great. I will look into this.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

> Hi All
> 
> Here is a patch for new feature "Enable specifying 
> SQL patterns lists that should not be load-balanced".
> 
> Even though currently we can do this by adding the 
> /*NO LOAD BALANCE*/ comment to queries, this requires 
> modifying application codes and this is not always 
> possible.
> 
> This feature enables specifying SQL patterns lists 
> that should not be load-balanced.
> 
> -------------
> New parameter
> -------------
> black_query_pattern_list = ''
> 
> You can specify a semicolon separated list of SQL patterns 
> that should be sent to primary node only. 
> 
> SQL that matched patterns specified in this list are not load balanced. 
> Only Maste Slave mode is supported.
> 
> You can use regular expression to match SQL patterns, 
> to which ^ and $ are automatically added. 
> When using characters such as "'", ";" or "*" in SQL patterns, 
> you need to escape them using "\". 
> 
> 
> Example: 
> 
> If the following SQL should be sent to the primary node only,
> 
>     SELECT * FROM table_name1;
> 
>     SELECT * FROM table_name2 WHERE col LIKE '%a%';
> 
>     SQL including table_nama3 
> 
> You can set the black_query_pattern_list like below:
> 
> black_query_pattern_list = 'SELECT \* FROM table_name1\;;SELECT col1, col2 FROM table_name2 WHERE col1 LIKE \\'%a%\\'\;;.*table_name3.*'
>           
> -- 
> Bo Peng <pengbo at sraoss.co.jp>
> SRA OSS, Inc. Japan


More information about the pgpool-hackers mailing list