Modify

Ticket #1215 (closed enhancement: wontfix)

Opened 14 months ago

Last modified 14 months ago

Create 'CONCURRENTLY' index

Reported by: stephane.raimbault@… Owned by: andrew
Priority: major Milestone:
Component: migrations Version: unknown
Keywords: Cc:

Description

It's very important on production databases to build index without taking any locks.

PostgreSQL is able to do that with CREATE INDEX CONCURRENTLY but it's certainly not supported by all databases, so at least, I'm looking for a way to create this index with South. This PostgreSQL command can only be used outside a transaction and I don't know if it's to possible to run a migration without a transaction.

CONCURRENTLY
When this option is used, PostgreSQL will build the index without
taking any locks that prevent concurrent inserts, updates, or deletes
on the table; whereas a standard index build locks out writes (but
not reads) on the table until it's done. There are several caveats to
be aware of when using this option

Attachments

Change History

comment:1 Changed 14 months ago by andrew

  • Status changed from new to closed
  • Resolution set to wontfix

There are no plans to implement CREATE INDEX CONCURRENTLY in South - it's a PostgreSQL-specific feature, and migrations are always run inside transactions.

If you want to use it, you're free to use a snippet like the following:

db.commit_transaction()
db.execute("CREATE INDEX CONCURRENTLY ...")
db.start_transaction()
View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.