This is not going to answer your question of course but did you already try to do this in 2 steps?
You said that the subquery itself doesn't take very long, so perhaps you can create a temporary table based on the subquery, then in the update do a join with the temporary table?
This might not be desirable in the end, but it might be useful just to check the performance of it.
And - isn't it an option to upgrade to 7.4.1 instead?
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
[mailto:pgsql-performance-owner(at)postgresql(dot)org]On Behalf Of Eric Jain
Sent: dinsdag 17 februari 2004 13:38
Subject: [PERFORM] UPDATE with subquery too slow
I can't get the following statement to complete with reasonable time.
I've had it running for over ten hours without getting anywhere. I
suspect (hope) there may be a better way to accomplish what I'm trying
to do (set fields containing unique values to null):
SET session = NULL
WHERE session IN
GROUP BY session
HAVING COUNT(*) = 1
pgsql-performance by date
|Next:||From: Konstantin Tokar||Date: 2004-02-17 12:54:54|
|Subject: Tables on multiple disk drives|
|Previous:||From: Eric Jain||Date: 2004-02-17 12:38:19|
|Subject: UPDATE with subquery too slow|