Re: [PATCH] SQL assertions prototype - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [PATCH] SQL assertions prototype
Date
Msg-id 20131218192228.GC26481@alap2.anarazel.de
Whole thread Raw
In response to Re: [PATCH] SQL assertions prototype  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: [PATCH] SQL assertions prototype
Re: [PATCH] SQL assertions prototype
List pgsql-hackers
On 2013-12-18 13:44:15 -0300, Alvaro Herrera wrote:
> Heikki Linnakangas wrote:
> 
> > Ah, I see. You don't need to block anyone else from modifying the
> > table, you just need to block anyone else from committing a
> > transaction that had modified the table. So the locks shouldn't
> > interfere with regular table locks. A ShareUpdateExclusiveLock on
> > the assertion should do it.
> 
> Causing serialization of transaction commit just because a single
> assertion exists in the database seems too much of a hit, so looking for
> optimization opportunities seems appropriate.

It would only force serialization for transactions that modify tables
covered by the assert, that doesn't seem to bad. Anything covered by an
assert shoulnd't be modified frequently, otherwise you'll run into major
performance problems.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: 9.3 regression with dbt2
Next
From: Jim Nasby
Date:
Subject: Re: [PATCH] SQL assertions prototype