Liquibase taking too long to execute changeset

Hi

Liquibase Version:3.2.0

Database Version: Oracle 12c

Java Version: 1.7

Jenkins Version: 1.544

Maven Version: 3.1.1

We are facing severe performance issue with liquibase particularly on DDL statement with precondition.

    <preConditions onFail="MARK_RAN"></div>

        <not></div>

        <columnExists tableName="COMMUNICATION" columnName="REPORTID" /></div>

        </not></div>

    </preConditions></div>

    <addColumn tableName="COMMUNICATION"></div>

        <column name="REPORTID" type="BIGINT"/></div>

    </addColumn></div>

The execution of the above changeset took approximately 4300702ms (1.2hrs). The table itself do not have any much data.

We are doing deployment to the database using Jenkins and maven. The Jenkins server is not co-located with the database server.

However we do not see any network traffic between Jenkins and DB server, no increase usage of memory or CPU.

  1. Is there any known issue with using pre-conditions?

  2. How can we improve the performance with the changeset?

  3. Will there be a performance improvement if Jenkins (from where maven will run the liquibase) and the database servers are located closer?

We got to abort production build due to above issue, appreciate if someone can shed some light in these areas.

Thanks in advance.

Sayee

How many rows and columns are in the current COMMUNICATION table? What else is going on when you try to run this update? Are there indexes/constraints/etc. on the table?

My guess is that the problem is not with Liquibase - you can run “liquibase updateSQL” to see what SQL is generated, and it is most likely very simple. So the problem is probably on the database end of things.

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Hi Steve

Thanks for your reply.

  1. The table is empty.

  2. There are no indexes added at that point.

  3. Primary key and foriegn key constraints are present.

If we debug and see there are lots of checks happening on the database

SELECT TEXT FROM ALL_VIEWS WHERE upper(VIEW_NAME)=‘ABC’ AND OWNER=‘XYZ’

For this particular scenario, it has checked nearly 963 such select statements.

We also think if the precondition check fails, (i.e. in this case the column is not present in the table) thats when liquibase does all these check on the database before adding a column to the table.

Any thoughts?

Regards

Sayee

I created https://liquibase.jira.com/browse/CORE-2281 to investigate the issue further. I’ve done some snapshot performance improvement since 3.2.0, can you try it with the neweest 3.3.2 version?

Nathan

Hi Nathan

Thanks a lot for your reply and creating a ticket in liquibase core forum. I am just curious to know did you find similar issue when you were doing performance improvements on version 3.2.0? I will definitely take your suggestion for upgrading liquibase to the newer version. However do you know is there any similar issue fixed in 3.3.2? If you can provide me any related details that will be great and I can share those with my team, take your suggestions further. I will eagerly wait for the response on the other ticket as well.

Thanks

Sayee