require-concurrent-index-creation
#
problemDuring a normal index creation, table updates are blocked, but reads are still allowed. CONCURRENTLY
avoids locking the table against writes during index creation.
https://www.postgresql.org/docs/current/sql-createindex.html#SQL-CREATEINDEX-CONCURRENTLY
#
solutionEnsure all index creations use the CONCURRENTLY
option.
This rule ignores indexes added to tables created in the same transaction.
#
create indexInstead of:
Use:
#
solution for alembic and sqlalchemyInstead of:
Use:
Notes:
In a concurrent index build, the index is actually entered as an “invalid” (details)