<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 2, 2019 at 5:10 AM Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</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">Thank you Usama!<br>
<br>
I have updated the 4.1 release note to reflect this patch.<br>
Compiled HTML files can be seen at:<br>
<a href="http://tatsuo-ishii.github.io/pgpool-II/current/release-4-1.html" rel="noreferrer" target="_blank">http://tatsuo-ishii.github.io/pgpool-II/current/release-4-1.html</a></blockquote><div><br></div><div>Many thanks Ishii-San</div><div><br></div><div>Best Regards</div><div>Muhammad Usama</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.jp</a><br>
<br>
From: Muhammad Usama &lt;<a href="mailto:m.usama@gmail.com" target="_blank">m.usama@gmail.com</a>&gt;<br>
Subject: [pgpool-committers: 5948] pgpool: Multiple performance enhancements especially for of the large<br>
Date: Thu, 01 Aug 2019 20:27:36 +0000<br>
Message-ID: &lt;<a href="mailto:E1htHfk-0006TZ-63@gothos.postgresql.org" target="_blank">E1htHfk-0006TZ-63@gothos.postgresql.org</a>&gt;<br>
<br>
&gt; Multiple performance enhancements especially for of the large<br>
&gt; INSERT and UPDATE statements<br>
&gt; <br>
&gt; Pgpool-II only needs very little information, especially for the INSERT and<br>
&gt; UPDATE statements to decide where it needs to send the query.<br>
&gt; For example: In master-slave mode, for the INSERT statements Pgpool-II only<br>
&gt; requires the relation name referenced in the statement while it doesn&#39;t care<br>
&gt; much about the column values and other parameters. But since the parser we use<br>
&gt; in Pgpool-II is taken from PostgreSQL source which parses the complete query<br>
&gt; including the value lists which seems harmless for smaller statements but in<br>
&gt; case of INSERT and UPDATE with lots of column values and large data in value<br>
&gt; items, consumes significant time.<br>
&gt; <br>
&gt; So the idea here is to short circuit the INSERT and UPDATE statement parsing as<br>
&gt; soon as we have the required information. For that purpose, the commit adds the<br>
&gt; second minimal parser that gets invoked in master-slave mode and tries to<br>
&gt; extract the performance for large INSERT and UPDATE statements.<br>
&gt; <br>
&gt; Apart from the second parser addition, following changes aiming towards the<br>
&gt; performance enhancements are also part of the commit.<br>
&gt; <br>
&gt; 1-Some of the if statements in pool_where_to_send() function are re-arranged to<br>
&gt; make sure the more expensive functions calls, pattern_compare()<br>
&gt; and pool_has_function_call() should only be made when they are<br>
&gt; absolutely necessary.<br>
&gt; <br>
&gt; 2- Eliminates the raw_parser() calls in case of un-recognized queries. Instead<br>
&gt; of invoking the parser on &quot;dummy read&quot; and &quot;dummy write&quot; statements, the commit<br>
&gt; adds the functions to return the pre-built parse_trees for these dummy queries.<br>
&gt; <br>
&gt; 3-- strlen() call is removed from scanner_init() function and is passed to it<br>
&gt; as an argument. The reason being we already have the query length in most cases<br>
&gt; before invoking the parser so why waste CPU cycles on it. Again this becomes<br>
&gt; significant in case of large query strings.<br>
&gt; <br>
&gt; 4- Removes some of the unnecessary calls of pool_is_likely_select() function.<br>
&gt; <br>
&gt; Branch<br>
&gt; ------<br>
&gt; master<br>
&gt; <br>
&gt; Details<br>
&gt; -------<br>
&gt; <a href="https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=310c5c4a289cbe6cee01abef7d2e7bc3550944fb" rel="noreferrer" target="_blank">https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=310c5c4a289cbe6cee01abef7d2e7bc3550944fb</a><br>
&gt; <br>
&gt; Modified Files<br>
&gt; --------------<br>
&gt; Makefile.in                                        |     1 +<br>
&gt; configure                                          |    59 +<br>
&gt; <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a>                                       |    12 +<br>
&gt; doc.ja/Makefile.in                                 |     1 +<br>
&gt; doc.ja/src/Makefile.in                             |     1 +<br>
&gt; doc.ja/src/sgml/Makefile.in                        |     1 +<br>
&gt; doc/Makefile.in                                    |     1 +<br>
&gt; doc/src/Makefile.in                                |     1 +<br>
&gt; doc/src/sgml/Makefile.in                           |     1 +<br>
&gt; src/Makefile.in                                    |     1 +<br>
&gt; src/context/pool_query_context.c                   |    42 +-<br>
&gt; src/include/Makefile.in                            |     1 +<br>
&gt; src/include/parser/gramparse.h                     |     6 +<br>
&gt; src/include/parser/parser.h                        |     5 +-<br>
&gt; src/include/parser/scanner.h                       |     1 +<br>
&gt; src/include/protocol/pool_proto_modules.h          |     2 -<br>
&gt; src/libs/Makefile.in                               |     1 +<br>
&gt; src/libs/pcp/Makefile.in                           |     1 +<br>
&gt; src/parser/Makefile.am                             |    10 +-<br>
&gt; src/parser/Makefile.in                             |    37 +-<br>
&gt; src/parser/README                                  |    49 +<br>
&gt; src/parser/gram.c                                  |  3255 +-<br>
&gt; src/parser/gram.y                                  |     7 +-<br>
&gt; src/parser/gram_minimal.c                          | 46971 +++++++++++++++++++<br>
&gt; src/parser/gram_minimal.h                          |  1053 +<br>
&gt; src/parser/gram_minimal.y                          | 16403 +++++++<br>
&gt; src/parser/gram_template.y                         | 16492 +++++++<br>
&gt; src/parser/parser.c                                |    84 +-<br>
&gt; src/parser/scan.c                                  |     2 +-<br>
&gt; src/parser/scan.l                                  |     2 +-<br>
&gt; src/protocol/pool_process_query.c                  |     2 +-<br>
&gt; src/protocol/pool_proto_modules.c                  |    35 +-<br>
&gt; .../tests/010.rewrite_timestamp/timestamp/main.c   |     2 +-<br>
&gt; .../regression/tests/017.node_0_is_down/test.sh    |     4 +-<br>
&gt; src/tools/Makefile.in                              |     1 +<br>
&gt; src/tools/pcp/Makefile.in                          |     1 +<br>
&gt; src/tools/pgenc/Makefile.in                        |     1 +<br>
&gt; src/tools/pgmd5/Makefile.in                        |     1 +<br>
&gt; src/tools/pgproto/Makefile.in                      |     1 +<br>
&gt; src/watchdog/Makefile.in                           |     1 +<br>
&gt; 40 files changed, 82852 insertions(+), 1700 deletions(-)<br>
&gt; <br>
</blockquote></div></div>