Re: Very strange performance decrease when reusing a PreparedStatement

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: John Lister <john(dot)lister(at)kickstone(dot)com>
Cc: Dave Cramer <pg(at)fastcrypt(dot)com>, Péter Kovács <maxottovonstirlitz(at)gmail(dot)com>, Frédérik Bilhaut <frederik(dot)bilhaut(at)noopsis(dot)fr>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Very strange performance decrease when reusing a PreparedStatement
Date: 2009-05-03 23:28:23
Message-ID: 49FE2897.3020802@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

John Lister wrote:

> However it seems that other optimisations can't be made for example it
> doesn't seem possible to tell the server that parameter 1 is always
> going to be an int and therefore it should be using index A. The current
> implementation may not use index A as it is unaware as to the type of
> the supplied parameter. Perhaps in this case the execution planner
> should pick the parameters for the most optimal plan and return the
> types during the parse and let the driver convert the data to what the
> server requires...

No it's not a problem with types at all, parameter types are fixed at
the point the named statement is created.

It's all about index selectivity statistics.

-O

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2009-05-03 23:43:23 Re: Very strange performance decrease when reusing a PreparedStatement
Previous Message Roland Roberts 2009-05-03 23:12:21 Re: Very strange performance decrease when reusing a PreparedStatement