Looking at the liquibase documention http://www.liquibase.org/documentation/changes/create_index.html, CIC is not possible with create index, as liquibase doesn't have a tag to specify concurrent option.
Is there a way to create index concurrently with liquibase?
What is CREATE INDEX concurrently? In a concurrent index build, the index is actually entered into the system catalogs in one transaction, then two table scans occur in two more transactions. Before each table scan, the index build must wait for existing transactions that have modified the table to terminate.
PostgreSQL provides the facility of creating index concurrently to avoid blocking and updating any table through the read and write commands.
To use Liquibase and PostgreSQL, you need the JDBC driver JAR file (Maven download). The latest version of Liquibase has a pre-installed driver for this database in the liquibase/internal/lib directory.
PostgreSQL automatically creates a unique index when a unique constraint or primary key is defined for a table. The index covers the columns that make up the primary key or unique constraint (a multicolumn index, if appropriate), and is the mechanism that enforces the constraint.
You can specify runInTransaction
as false
to create the index concurrently.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With