<html><head><meta http-equiv="content-type" content="text/html; charset=GB2312"><style>body { line-height: 1.5; }body { font-size: 10.5pt; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<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 = 'transaction'. 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= 'tb_t1:tb_t2,insert_tb_f_func():tb_f,tb_v:tb_v_view'</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>sunbiao@highgo.com</div></div></span></div>
</body></html>