Re: Online index builds

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, Ragnar <gnari(at)hive(dot)is>, pgsql-general(at)postgresql(dot)org
Subject: Re: Online index builds
Date: 2006-12-12 23:40:37
Message-ID: 27656.1165966837@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-announce pgsql-general pgsql-www

Jeff Davis <pgsql(at)j-davis(dot)com> writes:
> My point was that, because we can run it in multiple transactions, can't
> we drop the nonexclusive lock before acquiring the exclusive lock,

No. What happens if someone renames the table out from under you, to
mention just one possibility? If you've been holding nonexclusive lock
for a long time (as you would've been) there's a nontrivial chance that
someone is already queued up for an exclusive lock and will get in
before you do.

regards, tom lane

In response to

Responses

Browse pgsql-announce by date

  From Date Subject
Next Message Jeff Davis 2006-12-13 00:04:20 Re: Online index builds
Previous Message Jeff Davis 2006-12-12 23:33:18 Re: Online index builds

Browse pgsql-general by date

  From Date Subject
Next Message Glen Parker 2006-12-12 23:49:06 Re: PITR and moving objects between table spaces
Previous Message Brian Wipf 2006-12-12 23:38:47 Re: Statement timeout not working on broken connections with active queries

Browse pgsql-www by date

  From Date Subject
Next Message Jeff Davis 2006-12-13 00:04:20 Re: Online index builds
Previous Message Jeff Davis 2006-12-12 23:33:18 Re: Online index builds