<div dir="ltr">Hi Sunbiao,<br><br>Thanks for the patch and it looks line an interesting feature. I have just skimmed<br>through the patch and I have a few of small comments.<br><br>1 - Wouldn&#39;t it be better to add a new mode existing disable_load_balance_on_write parameter<br>instead of adding a new configuration parameter i.e dml_object_level_load_balance ?<br>You can make disable_load_balance_on_write to accept new value like<br>disable_load_balance_on_write = &#39;object&#39; to enable this feature.<br><br>2- The patch contains some invalid changes in pgpool.conf.sample-stream file<br>i.e it changes the default values of black_function_list and disable_load_balance_on_write<br>configuration parameters which I am sure were not intended<br><br>3- The default value for new configuration parameter dml_object_level_load_balance_token_list<br>better be an empty<br><br>4- Instead of attaching a separate test script you could include a proper test case for the feature.<br><br>Thanks<br>Best Regards<br><br><div><font color="#666666">Muhammad Usama<br>Highgo Software (Canada/China/Pakistan) <br>URL : <a href="http://www.highgo.ca">http://www.highgo.ca</a> <br>ADDR: 10318 WHALLEY BLVD, Surrey, BC </font><div><br></div></div></div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 24, 2020 at 3:43 PM <a href="mailto:sunbiao@highgo.com">sunbiao@highgo.com</a> &lt;<a href="mailto:sunbiao@highgo.com">sunbiao@highgo.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<div><span></span><div>Hi Hackers,</div><div>If sql like below:</div><div><br></div><div>begin ;</div><div>update tb_1 SET id = 1;</div><div>select * from tb_1 ;</div><div>select * from tb_2 ;</div><div>select * from tb_3 ;</div><div>select * from tb_4 ;</div><div>select * from tb_5 ;</div><div>commit ;</div><div><br></div><div>when set disable_load_balance_on_write = &#39;transaction&#39;. write queries appear in an explicit transaction, subsequent read queries are not load balanced until the transaction ends. so all sql will be sent to primary node.</div><div><br></div><div>i think that “update tb_1 SET id = 1” and “select * from tb_1” should be sent to primary node.</div><div>actually, tb_2 tb_3 tb_4 tb_5 can be sent to standby node. if do this, will reduce primary load.</div><div><br></div><div>so i made a patch to implement my idea.</div><div>when transaction start, i will initialize a list to save table name of write queries.</div><div>read queries will check the list, if find the table name in list, read queries will be sent to primary.</div><div>when transaction end, i destroy the list.</div><div><br></div><div>i add two parameter:</div><div><br></div><div>dml_object_level_load_balance = on</div><div>dml_object_level_load_balance_token_list= &#39;tb_t1:tb_t2,insert_tb_f_func():tb_f,tb_v:tb_v_view&#39;</div><div><br></div><div>use dml_object_level_load_balance_token_list to set relationships between objects, such as trigger, function, view.</div><div>If set dml_object_level_load_balance = on, disable_load_balance_on_write should be off.</div><div><br></div><div>Is it possible to add this feature?</div></div><hr style="width:210px;height:1px" color="#b5c4df" size="1" align="left">
<div><span><div style="margin:10px;font-family:verdana;font-size:10pt"><div><a href="mailto:sunbiao@highgo.com" target="_blank">sunbiao@highgo.com</a></div></div></span></div>
</div>_______________________________________________<br>
pgpool-hackers mailing list<br>
<a href="mailto:pgpool-hackers@pgpool.net" target="_blank">pgpool-hackers@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-hackers" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-hackers</a><br>
</blockquote></div>