pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Simon Riggs <simon@2ndQuadrant.com>
To: Roland Roberts <roland@astrofoto.org>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Very strange performance decrease when reusing a PreparedStatement
Date: Wed, 06 May 2009 22:59:54 +0100
Message-ID: <1241647194.6109.52.camel@ebony.2ndQuadrant> (raw)
In-Reply-To: <49FDEB97.6050800@astrofoto.org>
References: <5C2E1645-73B6-4509-96CD-FA77869516AB@noopsis.fr>
	<49F71EDD.2070200@opencloud.com>
	<02437794-A78D-449C-843F-B823195F9623@noopsis.fr>
	<fdeb32eb0905030122t665113e5nd34e7268d9ab1863@mail.gmail.com>
	<491f66a50905030310j5b4cdcd8jbf4f6e757c2ba580@mail.gmail.com>
	<fdeb32eb0905030928j4e72f1e3vbecb78d0cb74be58@mail.gmail.com>
	<49FDEB97.6050800@astrofoto.org>


On Sun, 2009-05-03 at 15:08 -0400, Roland Roberts wrote:

> At least PostgreSQL has the ability to tell the parser to reparse
> every time you ask it to prepare the statement.  Oracle doesn't.  The
> solution for Oracle isn't relevant, but the real point here is that
> your code may have to become smarter to help out the optimizer.  We
> reparse on every execution, but can't control Oracle's server-side
> cache.  PostgreSQL lets you control that with prepareThreshold=0.  If
> we'd had that option with Oracle, we would have had an easy solution.
> I'd say PostgreSQL's implementation for this case is a good one.

We have a good feature there, definitely. Although there is still more
to be done.

Oracle's cursor_sharing features are slightly ahead of Postgres,
specifically around the "SIMILAR" option. 

We talked a few years back about an "Option node" that would select
sub-plans at runtime based upon the actual values of the bind variable.
Nobody's got around to doing anything with that yet.

-- 
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support




view thread (26+ messages)  latest in thread

Message-ID: <1241647194.6109.52.camel@ebony.2ndQuadrant>
Permalink:  ../1241647194.6109.52.camel@ebony.2ndQuadrant/
Also on:    postgresql.org/message-id/1241647194.6109.52.camel@ebony.2ndQuadrant

 · 

reply

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-jdbc@postgresql.org
  Cc: simon@2ndQuadrant.com, roland@astrofoto.org
  Subject: Re: Very strange performance decrease when reusing a PreparedStatement
  In-Reply-To: <1241647194.6109.52.camel@ebony.2ndQuadrant>
  References: <5C2E1645-73B6-4509-96CD-FA77869516AB@noopsis.fr> <49F71EDD.2070200@opencloud.com> <02437794-A78D-449C-843F-B823195F9623@noopsis.fr> <fdeb32eb0905030122t665113e5nd34e7268d9ab1863@mail.gmail.com> <491f66a50905030310j5b4cdcd8jbf4f6e757c2ba580@mail.gmail.com> <fdeb32eb0905030928j4e72f1e3vbecb78d0cb74be58@mail.gmail.com> <49FDEB97.6050800@astrofoto.org> <1241647194.6109.52.camel@ebony.2ndQuadrant>

* 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