Re: Very strange performance decrease when reusing a PreparedStatement - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Very strange performance decrease when reusing a PreparedStatement
Date
Msg-id 49FE2897.3020802@opencloud.com
Whole thread Raw
In response to Very strange performance decrease when reusing a PreparedStatement  (Frédérik Bilhaut <frederik.bilhaut@noopsis.fr>)
List 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

pgsql-jdbc by date:

Previous
From: Roland Roberts
Date:
Subject: Re: Very strange performance decrease when reusing a PreparedStatement
Next
From: Oliver Jowett
Date:
Subject: Re: Very strange performance decrease when reusing a PreparedStatement