Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

BUG #3500: Horrible performance when wrong type is set in prepared statement



The following bug has been logged online:

Bug reference:      3500
Logged by:          Flavio Botelho
Email address:      fbotelho(at)stj(dot)gov(dot)br
PostgreSQL version: 8.1.8
Operating system:   Linux - Red Hat -- Linux somewhere 2.6.11-1.1369_FC4smp
#1 SMP Thu Jun 2 23:08:39 EDT 2005 i686 i686 i386 GNU/Linux
Description:        Horrible performance when wrong type is set in prepared
statement
Details: 

We have id fields (set to integer types) that were being passed to our JDBC
as string types and being set so in the prepared statements.

This seems to produce the right result anyway (i didnt investigate, but i
suspect so as if this was not the case someone would have seem such a big
bug in the application).

But performance gets absurdly bad, from a index scan to a table scan.

I know the application should not be doing this. But i wonder if lots of the
complaints about postgres performance couldnt be related to problems like
this. I suggest that you change the behaviour of something like that from
silently accepting the string value to throwing an error.

Or if you really want to be nice for these users try to fit the right type
before matching the possible indexes...

Thanks for the hard work.



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group