Re: Transaction isolation and constraints - Mailing list pgsql-general

From Bruce Momjian
Subject Re: Transaction isolation and constraints
Date
Msg-id 200712160641.lBG6fqR20564@momjian.us
Whole thread Raw
In response to Re: Transaction isolation and constraints  (cliff@krumvieda.com)
List pgsql-general
cliff@krumvieda.com wrote:
> Hi, Tom:
>
> >Whichever one manages to get to the index page first will go through.
> >The second one will block waiting to see if the first one commits,
> >and will error out if so --- or proceed, if it aborts.
>
> I see, this makes sense.  What if the two transactions insert rows
> that don't violate the constraint: will they be able to proceed in
> parallel?  Or will one wait for the other, because they both need to
> update the shared index?  I.e., does the mechanism work by waiting for
> one index update to commit before permitting the next?

They proceed in parallel.  Backends wait only on specific rows that
conflict, not the index page.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

pgsql-general by date:

Previous
From: Erik Jones
Date:
Subject: Re: limits
Next
From: Bruce Momjian
Date:
Subject: Re: Recovering data via raw table and field separators