Parameterized Query Pegs the DB

From: Michael Daines <Michael_Daines(at)rapid7(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Parameterized Query Pegs the DB
Date: 2012-01-11 23:10:06
Message-ID: 3B704C911550A340BE8731F1331016D505C0C72356@exchange01.tor.rapid7.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I've got a situation where a user was seeing their database pegged at 100% CPU usage. We tracked it down to a parameterized query, and when we removed the process that was launching the query, it solved the problem. I still don't understand what caused the problem, though. I've searched around in the old messages and FAQ and google and didn't find anything that helped.

The one thing that stands out at this point is that the parameters aren't written to the log file.

For other parameterized queries, the logs will look like this:

2011-12-02 13:33:58 MSTLOG: duration: 0.028 ms execute <unnamed>: SELECT COUNT(*) FROM table_name WHERE field = $1
2011-12-02 13:33:58 MSTDETAIL: parameters: $1 = 'value'

But for the query that was causing a problem, there is never an "MSTDETAIL" line showing the parameters.

We're using PostgreSQL 9.0 and accessing via JDBC.

Thanks for any help/insight you can provide.

msd
This electronic message contains information which may be confidential or privileged. The information is intended for the use of the individual or entity named above. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify us by e-mail at (postmaster(at)rapid7(dot)com) immediately.

Browse pgsql-general by date

  From Date Subject
Next Message Kirill Müller 2012-01-11 23:27:58 Re: Enumeration of tables is very slow in largish database
Previous Message Manoj Govindassamy 2012-01-11 21:50:48 PG synchronous replication and unresponsive slave