From: Kris Jurka <books@ejurka.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Dave Crooke <dcrooke@gmail.com>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: pgsql-jdbc@postgresql.org, pgsql-performance <pgsql-performance@postgresql.org>
Cc: Scott Carey <scott@richrelevance.com>
Subject: Re: SOLVED ... Re: Getting rid of a cursor from JDBC .... Re: [PERFORM] Re: HELP: How to tame the 8.3.x JDBC driver with a biq guery result set
Date: Wed, 21 Apr 2010 13:58:51 -0400 (EDT)
Message-ID: <alpine.BSO.2.00.1004211354300.9190@leary.csoft.net> (raw)
In-Reply-To: <g2w603c8f071004210741y69db6e92p5a7d18c4fc2940a@mail.gmail.com>
References: <q2sca24673e1004191633j10b1124amf1eb51f3bd84f19a@mail.gmail.com>
<4BCD73AF0200002500030BC2@gw.wicourts.gov>
<w2kca24673e1004200847k77429a1cra0a6f3560d407d8e@mail.gmail.com>
<4BCD90D80200002500030BDD@gw.wicourts.gov>
<x2zca24673e1004201229n653f4e69vd274af4a4aa22d09@mail.gmail.com>
<4BCDC6B90200002500030C09@gw.wicourts.gov>
<w2oca24673e1004201340p703b0121iaf852aa28695be65@mail.gmail.com>
<alpine.BSO.2.00.1004201644280.6736@leary.csoft.net>
<g2w603c8f071004210741y69db6e92p5a7d18c4fc2940a@mail.gmail.com>
On Wed, 21 Apr 2010, Robert Haas wrote:
> On Tue, Apr 20, 2010 at 5:05 PM, Kris Jurka <books@ejurka.com> wrote:
>>
>> b) Using the parameter values for statistics, but not making any stronger
>> guarantees about them. So the parameters will be used for evaluating the
>> selectivity, but not to perform other optimizations like contraint_exclusion
>> or transforming a LIKE operation to a range query. This is the default plan
>> type the JDBC driver uses.
>
> Hmm. I didn't think this was possible. How are you doing this?
This is only possible at the protocol level, it's not available using SQL
commands only. You do this by creating an unnamed instead of a named
statement:
http://www.postgresql.org/docs/8.4/static/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
Query planning for named prepared-statement objects occurs when
the Parse message is processed. If a query will be repeatedly
executed with different parameters, it might be beneficial to send
a single Parse message containing a parameterized query, followed
by multiple Bind and Execute messages. This will avoid replanning
the query on each execution.
The unnamed prepared statement is likewise planned during Parse
processing if the Parse message defines no parameters. But if
there are parameters, query planning occurs during Bind processing
instead. This allows the planner to make use of the actual values
of the parameters provided in the Bind message when planning the
query.
Kris Jurka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: books@ejurka.com, robertmhaas@gmail.com, dcrooke@gmail.com, Kevin.Grittner@wicourts.gov, scott@richrelevance.com
Subject: Re: SOLVED ... Re: Getting rid of a cursor from JDBC .... Re: [PERFORM] Re: HELP: How to tame the 8.3.x JDBC driver with a biq guery result set
In-Reply-To: <alpine.BSO.2.00.1004211354300.9190@leary.csoft.net>
References: <q2sca24673e1004191633j10b1124amf1eb51f3bd84f19a@mail.gmail.com> <4BCD73AF0200002500030BC2@gw.wicourts.gov> <w2kca24673e1004200847k77429a1cra0a6f3560d407d8e@mail.gmail.com> <4BCD90D80200002500030BDD@gw.wicourts.gov> <x2zca24673e1004201229n653f4e69vd274af4a4aa22d09@mail.gmail.com> <4BCDC6B90200002500030C09@gw.wicourts.gov> <w2oca24673e1004201340p703b0121iaf852aa28695be65@mail.gmail.com> <alpine.BSO.2.00.1004201644280.6736@leary.csoft.net> <g2w603c8f071004210741y69db6e92p5a7d18c4fc2940a@mail.gmail.com> <alpine.BSO.2.00.1004211354300.9190@leary.csoft.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox