Re: set-level update fails with unique constraint violation - Mailing list pgsql-general

From Tom Lane
Subject Re: set-level update fails with unique constraint violation
Date
Msg-id 7714.1263055182@sss.pgh.pa.us
Whole thread Raw
In response to Re: set-level update fails with unique constraint violation  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-general
"Daniel Verite" <daniel@manitou-mail.org> writes:
>     Tom Lane wrote:
>> 1. Performance.  The cost of #2 is very large, and the number of cases
>> where you actually need it is not.

> Per Dean's explanation upthread, It looks like an additional cost for #2
> would occur mostly when temporary conflicts occur, that is, when it's needed.

I'm not sure where you got that from his explanation, but it's not the
case.  The problem with any type of delayed verification is that it
requires a second index search, on top of the one you already did while
making your index entry.  This occurs whether or not there is any conflict.
The problem is especially acute when you have an update or insert
affecting a large fraction of the table.

            regards, tom lane

pgsql-general by date:

Previous
From: Keaton Adams
Date:
Subject: Re: WAL Log Shipping - Warm Standby not working under 8.3.7
Next
From: zxo102 ouyang
Date:
Subject: An issue with max() and order by ... limit 1 in postgresql8.3-beta3