On 10/12/2013, at 20:55, Jeff Janes wrote:
The object is used in a Java application. Basically, it goes into a queue in memory. Some of its data is updated in two different tables in the same database at a later time, but only after some logic has been performed which may or may not change them relative to what they were when they came from the partner.
I'm not using DELETE...RETURNING because basically the application that's running is old code, originally written around 2002 or so, before we even had PostgreSQL in the organization. I will probably not get permission to change this code without very good reason as it is a sensitive bit of code.
They are the simplest queries possible. The performance deterioration is only fractions of a second, you see. But when we have thousands of status reports per minute, it builds up to a large delay after a few minutes.
The queries are: select id, sm from transient where smsc_reference = ? and msisdn = ? and then: delete from transient where id = ?
Well, I simplified a bit, but as you can see from the query above, it queries on both the smsc_reference and the msisdn.
Thanks, Herouth |