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

From: "Flavio Botelho" <fbotelho(at)stj(dot)gov(dot)br>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3500: Horrible performance when wrong type is set in prepared statement
Date: 2007-07-30 22:36:09
Message-ID: 200707302236.l6UMa90q045574@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Decibel! 2007-07-31 01:20:25 Re: BUG #3484: Missing pg_clog file / corrupt index
Previous Message Kirill Simonov 2007-07-30 22:28:37 BUG #3499: no owner privileges in information_schema.table_privileges