Re: BUG #4945: Parallel update(s) gone wild - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4945: Parallel update(s) gone wild
Date
Msg-id 4174.1248989688@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #4945: Parallel update(s) gone wild  ("Dan Boeriu" <dan.boeriu@roost.com>)
List pgsql-bugs
"Dan Boeriu" <dan.boeriu@roost.com> writes:
> Attached is the reproducible test case - I was able to reproduce the problem on 32 and 64 bit 8.3.6 and 8.4.0 RedHat
5.3kernel 2.6.18-128.1.16.el5 #1 SMP 

I looked at this a bit.  It's the same issue discussed at
http://archives.postgresql.org/pgsql-bugs/2008-09/msg00045.php
namely, that the second update finds itself trying to update a large
number of tuples that were already updated since its snapshot was taken.
That means it has to re-verify that the updated versions of those tuples
meet its WHERE qualification.  That's done by a function EvalPlanQual
that's pretty darn inefficient for complex queries like this one.
It's essentially redoing the join (and recomputing the whole sub-SELECT)
for each row that needs to be updated.

Someday I'd like us to redesign that mechanism, but don't hold
your breath ...

            regards, tom lane

pgsql-bugs by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: fix: plpgsql: return query and dropped columns problem
Next
From: "Dan Boeriu"
Date:
Subject: Re: BUG #4945: Parallel update(s) gone wild