Ticket #1215 (closed enhancement: wontfix)

Opened 21 months ago

Last modified 21 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

Change History

comment:1 Changed 21 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()
Note: See TracTickets for help on using tickets.