Re: set-level update fails with unique constraint violation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
Cc: "Dean Rasheed" <dean(dot)a(dot)rasheed(at)googlemail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: set-level update fails with unique constraint violation
Date: 2010-01-09 16:39:42
Message-ID: 7714.1263055182@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Daniel Verite" <daniel(at)manitou-mail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message zxo102 ouyang 2010-01-09 16:43:08 An issue with max() and order by ... limit 1 in postgresql8.3-beta3
Previous Message Keaton Adams 2010-01-09 15:24:45 Re: WAL Log Shipping - Warm Standby not working under 8.3.7