# Preconditions takes more than 30 seconds each

**URL:** <https://forum.liquibase.org/t/preconditions-takes-more-than-30-seconds-each/815>\
**Category:** General Discussion\
**Created:** [September 21, 2010, 12:14pm UTC](https://forum.liquibase.org/t/preconditions-takes-more-than-30-seconds-each/815 "2010-09-21T12:14:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bert\_vermeiren](https://avatars.discourse-cdn.com/v4/letter/b/f6c823/32.png) [@bert\_vermeiren](https://forum.liquibase.org/u/bert_vermeiren)\
**Post date:** [September 21, 2010, 12:14pm UTC](https://forum.liquibase.org/t/preconditions-takes-more-than-30-seconds-each/815/1 "2010-09-21T12:14:00Z")

</div>

Following changeSet :

&nbsp; &nbsp;

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

```

&nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp;

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

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [September 21, 2010, 12:14pm UTC](https://forum.liquibase.org/t/preconditions-takes-more-than-30-seconds-each/815/2 "2010-09-21T12:14:00Z")

</div>

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

Nathan
