Hello.<div><br></div><div>Sorry for the delay. I'll correct what you said and I'm going to write a document with implementation details.</div><div>But I need time, maybe a week or two.</div><div><br></div><div>Best regards,</div>
<div>Alexey Fedonin.<br><br><div class="gmail_quote">2013/2/10 Tatsuo Ishii <span dir="ltr"><<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im HOEnZb">On more thing. pcp/md.c and pcp/md5.h is a symlink to upper directory<br>
and shound not be included in the patch.<br>
</div><div class="HOEnZb"><div class="h5">--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
<br>
> Thanks.<br>
><br>
> I have tested a little bit your patches and now I would like to hear<br>
> more details of implementation because your changes are big and hard<br>
> to follow implementation details for me(especially<br>
> pool_process_query.c).<br>
><br>
> Also here are some requests:<br>
><br>
> 1) please include doc changes. (i.e. doc/pgpool-en.html)<br>
><br>
> 2) we do not use C++ style codings (we follow the PostgreSQL coding<br>
> style). So please do not use '//' comments. Also please do not<br>
> declare variable in the middle of blocks. I mean:<br>
><br>
> if (a < b)<br>
> {<br>
> int d;<br>
><br>
> a = 1;<br>
> b = 2;<br>
> c = 3;<br>
> :<br>
> :<br>
> }<br>
><br>
> is ok but this is not ok:<br>
><br>
> if (a < b)<br>
> {<br>
> a = 1;<br>
> b = 2;<br>
> int c = 3;<br>
> :<br>
> :<br>
> }<br>
> --<br>
> Tatsuo Ishii<br>
> SRA OSS, Inc. Japan<br>
> English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
> Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
><br>
>> Sure.<br>
>><br>
>> Best regards,<br>
>> Alexey Fedonin.<br>
>><br>
>> 2013/2/1 Tatsuo Ishii <<a href="mailto:ishii@postgresql.org">ishii@postgresql.org</a>><br>
>><br>
>>> Alexey,<br>
>>><br>
>>> I tried to make a diff between current git repo master and you repo in<br>
>>> github and found yoursis based on a little bit older version of<br>
>>> repo. Can you please rebase it? Or even better, could you send diff<br>
>>> against current git repo master?<br>
>>> --<br>
>>> Tatsuo Ishii<br>
>>> SRA OSS, Inc. Japan<br>
>>> English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
>>> Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
>>><br>
>>> > Hello, everyone!<br>
>>> ><br>
>>> > I've added new features and improvements to pgpool (for parallel mode)<br>
>>> > which I would like to contribute as well as get feedback from the<br>
>>> community.<br>
>>> > Features:<br>
>>> > - Transaction support added (for SELECT * FROM distributed_table);<br>
>>> > - CURSORS support added (for distributed tables);<br>
>>> > - Dynamic connections to System DB (optional);<br>
>>> > - SELECT rewriting fixes (some improvements and some bugfixes).<br>
>>> ><br>
>>> > 1) Transactions.<br>
>>> > When client sends 'BEGIN' statement, pgpool child connects to another<br>
>>> child<br>
>>> > and resend all client statements to it, except for 'SELECT ... FROM<br>
>>> > distributed_table', which executes in usual way. In this case, 'SELECT<br>
>>> ...<br>
>>> > FROM distributed_table' executes inside the same transaction block as<br>
>>> well<br>
>>> > as other statements.<br>
>>> > The better way would be to use the same child's connections as it uses<br>
>>> for<br>
>>> > non-distributed SELECTs, but I haven't found the means of doing it.<br>
>>> ><br>
>>> > 2) Cursors.<br>
>>> > For example, we have two nodes and distributed table:<br>
>>> > Node 0 Node 1<br>
>>> ><br>
>>> > value value<br>
>>> > ------- -------<br>
>>> > 4 3<br>
>>> > 6 1<br>
>>> > 8 7<br>
>>> > 2 9<br>
>>> > 0 5<br>
>>> ><br>
>>> > a. BEGIN;<br>
>>> > b. DECLARE cursor_name CURSOR FOR SELECT value FROM distributed_table<br>
>>> > ORDER BY value;<br>
>>> > c. MOVE FORWARD 2 IN cursor_name;<br>
>>> > d. FETCH FORWARD 3 IN cursor_name:<br>
>>> ><br>
>>> > value<br>
>>> > -------<br>
>>> > 2<br>
>>> > 3<br>
>>> > 4<br>
>>> ><br>
>>> > CURSORS work for FORWARD/BACKWARD ALL/(positive number).<br>
>>> > Cursors work for any type of distribution, e.g. round-robin.<br>
>>> ><br>
>>> > 3) Dynamic connections (optional).<br>
>>> > If number of clients is not usually too high, it is not necessary to<br>
>>> have<br>
>>> > connections to System DB for free childs.<br>
>>> > New parameter 'system_db_dynamic_connection' added to config.<br>
>>> > If value of parameter is 0, child works as usual.<br>
>>> > If value > 0, child connects to System DB when client connects. Also,<br>
>>> > child without System DB connections sleeps for<br>
>>> > 'system_db_dynamic_connection' mcs before accepting new client. So new<br>
>>> > client will be accepted by child, which already has connections to System<br>
>>> > DB.<br>
>>> ><br>
>>> > 4) SELECT.<br>
>>> > SELECT rewriting logic was changed a little, and now more complex<br>
>>> queries<br>
>>> > work correctly, such as:<br>
>>> > a. SELECT field_1, (SELECT field_2 FROM replicated_table WHERE<br>
>>> > field_3=S1.field_3) AS field_2 FROM distributed_table S1;<br>
>>> > b. (SELECT field_1, (SELECT field_2 FROM replicated_table_1) AS field_2<br>
>>> > FROM distributed_table_1 S1) UNION ALL (SELECT field_1, (SELECT field_3<br>
>>> > FROM replicated_table_2) AS field_3 FROM distributed_table_2 S2) ORDER BY<br>
>>> > field_1;<br>
>>> > c. Also, 'ORDER BY + LIMIT + OFFSET' optimization added:<br>
>>> > SELECT field FROM distributed_table ORDER BY field LIMIT 10 OFFSET 100;<br>
>>> > rewrites into:<br>
>>> > SELECT "pool_c$1" AS field FROM dblink('host=localhost.localdomain<br>
>>> > dbname=dbname port=9999 user=username','SELECT pool_parallel("SELECT<br>
>>> > distributed_table.time FROM distributed_table ORDER BY field LIMIT 10 +<br>
>>> > 100")',false) AS pool_t$0("pool_c$1" field_type) ORDER BY "pool_c$1"<br>
>>> OFFSET<br>
>>> > 100 LIMIT 10;<br>
>>> > d. some bugfixes.<br>
>>> ><br>
>>> > If you are interested in, I could explain each change in detail.<br>
>>> ><br>
>>> > Source code is available at <a href="https://github.com/afedonin/repo-test.git" target="_blank">https://github.com/afedonin/repo-test.git</a><br>
>>> ><br>
>>> > P.S. All changes was made and tested for parallel_mode.<br>
>>> > P.P.S. I don't know pgpool as good as you, so I appreciate any feedback.<br>
>>> ><br>
>>> > Best regards,<br>
>>> > Alexey Fedonin.<br>
>>><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> pgpool-hackers mailing list<br>
> <a href="mailto:pgpool-hackers@pgpool.net">pgpool-hackers@pgpool.net</a><br>
> <a href="http://www.pgpool.net/mailman/listinfo/pgpool-hackers" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-hackers</a><br>
</div></div></blockquote></div><br></div>