From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Daniel Farina <daniel(at)heroku(dot)com> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Should I implement DROP INDEX CONCURRENTLY? |
Date: | 2011-08-24 19:36:29 |
Message-ID: | CA+TgmoYvGjaARPofXTWC+OBVF13Nib2MLVcc7940w-91ZuQGtg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Aug 24, 2011 at 2:24 PM, Daniel Farina <daniel(at)heroku(dot)com> wrote:
> Could I make the ACCESS EXCLUSIVE section just long enough to commit
> catalog updates, and then have the bulk of the work happen afterwards?
>
> The general idea is:
>
> 1) set an index as "invalid", to ensure no backend will use it in planning
> 2) wait for the xmin horizon to advance to ensure no open snapshots
> that may not see the invalidation of the index are gone (is there a
> way to tighten that up? although even this conservative version would
> be 80-90% of the value for us...)
> 3) then use performDeletions without taking a lock on the parent
> table, similar to what's in tablecmds.c already.
>
> A DROP INDEX CONCURRENTLY may leave an invalid index if aborted
> instead of waiting for statement confirmation, just like CREATE INDEX
> CONCURRENTLY.
This might be a dumb idea, but could we rearrange CommitTransaction()
so that smgrDoPendingDeletes() happens just a bit further down, after
those ResourceOwnerRelease() calls? It seems like that might
accomplish what you're trying to do here without needing a new
command.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2011-08-24 19:38:09 | Re: Should I implement DROP INDEX CONCURRENTLY? |
Previous Message | Tom Lane | 2011-08-24 19:22:13 | Re: "make -j4 world" falls over |