[pgpool-hackers: 2801] Re: [New feature] Enable specifying SQL patterns lists that should not be load-balanced.
ishii at sraoss.co.jp
Mon May 14 12:59:00 JST 2018
Great. I will look into this.
SRA OSS, Inc. Japan
> 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
> 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 "\".
> 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