Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 1700F1337B58 for ; Thu, 7 Oct 2010 02:55:29 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 63854-04 for ; Thu, 7 Oct 2010 05:55:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ibms.sinica.edu.tw (mail1.ibms.sinica.edu.tw [140.109.40.109]) by mail.postgresql.org (Postfix) with ESMTP id 36404133616B for ; Thu, 7 Oct 2010 02:55:20 -0300 (ADT) Received: from [192.168.6.213] ([140.109.54.2]) (authenticated bits=0) by ibms.sinica.edu.tw (8.14.0/8.14.0) with ESMTP id o975t4gM026209; Thu, 7 Oct 2010 13:55:05 +0800 (CST) Subject: Re: The logic behind the prepared statement in PostgreSQL From: louis To: Oliver Jowett Cc: pgsql-jdbc@postgresql.org In-Reply-To: <4CACE716.5010600@opencloud.com> References: <1286365302.13691.35.camel@london> <4CAC696F.9020109@opencloud.com> <1286371782.17773.51.camel@london> <4CACE716.5010600@opencloud.com> Content-Type: text/plain; charset="UTF-8" Date: Thu, 07 Oct 2010 13:55:04 +0800 Message-ID: <1286430904.7465.4.camel@london> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.011 tagged_above=-10 required=5 tests=BAYES_20=-0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/58 X-Sequence-Number: 21026 On Thu, 2010-10-07 at 10:16 +1300, Oliver Jowett wrote: > louis wrote: > > > However, while tracing the call stack I found that the > > core.v3.QueryExecutorImpl.sendBind method sends a query statement Name > > to PGStream, does it mean JDBC driver use the statement name to identify > > the corresponding execution plan on a Postgresql server? > > I have such assumption since PGStream seems to be the connection between > > JDBC driver and the PostgreSQL server, and I can't find other obvious > > path for JDBC code to specify an execution plan on the server side. > > A Bind message associates parameter values with a previously created > statement. You probably want to read the docs that describe the FE/BE > protocol: http://www.postgresql.org/docs/9.0/static/protocol.html > > Oliver > Very helpful information. Much appreciated Louis