pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-hackers@postgresql.org
Subject: Re: [JDBC] 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102
Date: Mon, 18 Jan 2016 15:50:08 -0700 (MST)
Message-ID: <1453157408243-5882835.post@n5.nabble.com> (raw)
In-Reply-To: <CA+TgmoZRcmt6COb7YoLe0YwtWmKeyXjf5E++sEeUj6-zfSAjtA@mail.gmail.com>
References: <895FBF7B-D59B-4F58-A8B7-4F78C6A1D527@anarazel.de>
	<CAB=Je-Gqj_vAxu7uYd0oS-DYvnJHpCPVeARebLGmUD+dNpW6Ew@mail.gmail.com>
	<5696604E.2030903@joh.to>
	<CAB=Je-GazsaWgxQyRW_E=w7938vZH0Xm2gd7jhxE8y+2ixi_mg@mail.gmail.com>
	<569660D9.7010107@joh.to>
	<CAB=Je-FrTD=M3hMY2qcE8o-tSUpqnkHEwLpY2p-PkJSZS7+yxQ@mail.gmail.com>
	<20160113144318.7jcsd5wldolczjb5@alap3.anarazel.de>
	<CAB=Je-GoKYwmM5TOjYbgJrSYxPUEgJ2hwtFz4U1AWr8x2KKdpQ@mail.gmail.com>
	<31259.1452700038@sss.pgh.pa.us>
	<CA+TgmoZRcmt6COb7YoLe0YwtWmKeyXjf5E++sEeUj6-zfSAjtA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Robert Haas wrote:
> This isn't the first complaint about this mechanism that we've gotten,
> and it won't be the last.  Way too many of our users are way more
> aware than they should be that the threshold here is five rather than
> any other number, which to me is a clear-cut sign that this needs to
> be improved.  How to improve it is a harder question.  We lack the
> ability to do any kind of sensitivity analysis on a plan, so we can't
> know whether there are other parameter values that would have resulted
> in a different plan, nor can we test whether a particular set of
> parameter values would have changed the outcome.

(I initially posted that question on the JDBC mailing list)

To be honest: looking at the efforts Oracle has done since 9 up until 12 I
am not sure this is a problem that can be solved by caching plans. 

Even with the new "in-flight" re-planning in Oracle 12 ("cardinality
feedback") and all the effort that goes into caching plans we are still
seeing similar problems with (prepared) statements that are suddenly slow.
And as far as I can tell, the infrastructure around plan caching,
invalidation, bind variable peeking and all that seems to be a *lot* more
complex ("sophisticated") in Oracle compared to Postgres. And the results
don't seem to justify the effort (at least in my experience).

With all the problems I have seen (in Oracle and Postgres) I think that
maybe a better solution to this problem is to make the planner fast (and
reliable) enough so that plan caching isn't necessary in the first place. 

However I have no idea how feasible that is. 





--
View this message in context: http://postgresql.nabble.com/Fwd-JDBC-Re-9-4-1207-behaves-differently-with-server-side-prepared-stat...
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (72+ messages)  latest in thread

Message-ID: <1453157408243-5882835.post@n5.nabble.com>
Permalink:  ../1453157408243-5882835.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1453157408243-5882835.post@n5.nabble.com

 · 

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: spam_eater@gmx.net, pgsql-hackers@postgresql.org
  Subject: Re: [JDBC] 9.4-1207 behaves differently with server side prepared statements compared to 9.2-1102
  In-Reply-To: <1453157408243-5882835.post@n5.nabble.com>
  References: <895FBF7B-D59B-4F58-A8B7-4F78C6A1D527@anarazel.de> <CAB=Je-Gqj_vAxu7uYd0oS-DYvnJHpCPVeARebLGmUD+dNpW6Ew@mail.gmail.com> <5696604E.2030903@joh.to> <CAB=Je-GazsaWgxQyRW_E=w7938vZH0Xm2gd7jhxE8y+2ixi_mg@mail.gmail.com> <569660D9.7010107@joh.to> <CAB=Je-FrTD=M3hMY2qcE8o-tSUpqnkHEwLpY2p-PkJSZS7+yxQ@mail.gmail.com> <20160113144318.7jcsd5wldolczjb5@alap3.anarazel.de> <CAB=Je-GoKYwmM5TOjYbgJrSYxPUEgJ2hwtFz4U1AWr8x2KKdpQ@mail.gmail.com> <31259.1452700038@sss.pgh.pa.us> <CA+TgmoZRcmt6COb7YoLe0YwtWmKeyXjf5E++sEeUj6-zfSAjtA@mail.gmail.com> <1453157408243-5882835.post@n5.nabble.com>

* 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