Preconditions takes more than 30 seconds each

Following changeSet :

   

<preConditions>
	<not>
		<indexExists indexName="IDX_FK_ZYEYJGSMALNT3KGKIQDX3UA"/>
	</not>
</preConditions>

       

           

       

   

takes more than 30 seconds. for each such changeset

It seems according to the stacktrace that an internal databaseSnapshot is being created for every changeSet ???

at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.getForeignKeys(JdbcDatabaseSnapshotGenerator.java:505)
at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.readForeignKeyInformation(JdbcDatabaseSnapshotGenerator.java:380)
at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot(JdbcDatabaseSnapshotGenerator.java:221)
at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.hasIndex(JdbcDatabaseSnapshotGenerator.java:401)
at liquibase.precondition.core.IndexExistsPrecondition.check(IndexExistsPrecondition.java:63)
at liquibase.precondition.core.NotPrecondition.check(NotPrecondition.java:30)
at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.java:34)
at liquibase.precondition.core.PreconditionContainer.check(PreconditionContainer.java:199)

Using liquibase 2.0 rc 5

It is something we have been tryign to improve the performance of with 2.0, but the indexExists precondition still does a full snapshot.  I’ll look to see what we can do to improve it for the index check.  I created http://liquibase.jira.com/browse/CORE-715 to track it.

Nathan