Re: [PATCH] SQL assertions prototype

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Kevin Grittner <kgrittn(at)ymail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] SQL assertions prototype
Date: 2013-12-18 19:39:58
Message-ID: 20131218193958.GF11006@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund wrote:
> 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.

Well, as presented there is no way (for the system) to tell which tables
are covered by an assertion, is there? That's my point.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2013-12-18 19:42:53 Re: [PATCH] SQL assertions prototype
Previous Message Jim Nasby 2013-12-18 19:35:17 Re: [PATCH] SQL assertions prototype