3.5.5 migration to 3.6.0 and sup duration problem

Description

Hello,

I m using liquibase in version 3.5.5 and my script run fast, about 20 secondes to execute all of my script from scratch (empty Database)

Recently i have update my version to 3.6.3 and now, global time of execution is pass to 20minutes!! I have change nothing in my scripts, if i came back to 3.5.5 it take 20 secondes. I have also test 3.8.0 (the last release at this day).

I have put log level to DEBUG and in 3.5.5 script is executed like this :


INFO 18/09/19 16:20: liquibase: changelog-master-postgresql: classpath:db/changelogs/db.changelog-2018-06-04 15-08-postgresql.xml::1528117671-3::test: Foreign key constraint added to area (default_calendar_id)
INFO 18/09/19 16:20: liquibase: changelog-master-postgresql: classpath:db/changelogs/db.changelog-2018-06-04 15-08-postgresql.xml::1528117671-3::test: ChangeSet classpath:db/changelogs/db.changelog-2018-06-04 15-08-postgresql.xml::1528117671-3::test ran successfully in 20ms

Same with 3.8.0:


14:57:53.849 [DEBUG] [main] liquibase.snapshot.DatabaseSnapshot - Excluding seadog_pam_dev.production_item_input_aud.rev
14:57:53.862 [DEBUG] [main] liquibase.snapshot.DatabaseSnapshot - Excluding seadog_pam_dev.seadog_revision.id
14:57:53.862 [DEBUG] [main] liquibase.snapshot.DatabaseSnapshot - Excluding seadog_pam_dev.production_item_input_aud.revend
14:57:53.870 [DEBUG] [main] liquibase.changelog.ChangeSet - Reading ChangeSet: classpath:db/changelogs/db.changelog-2018-06-04 15-08-postgresql.xml::1528117671-3::test
14:57:53.870 [DEBUG] [main] l.database.core.PostgresDatabase - Executing Statement: liquibase.statement.core.AddForeignKeyConstraintStatement@437de8fb
14:57:53.870 [INFO ] [main] liquibase.executor.jvm.JdbcExecutor - ALTER TABLE area ADD CONSTRAINT fk_bqrilyrciwrbknvfcklavyvdt FOREIGN KEY (default_calendar_id) REFERENCES calendar (id) ON UPDATE NO ACTION ON DELETE NO ACTION
14:57:53.871 [DEBUG] [main] liquibase.executor.jvm.JdbcExecutor - 0 row(s) affected
14:57:53.871 [INFO ] [main] liquibase.changelog.ChangeSet - Foreign key constraint added to area (default_calendar_id)
14:57:53.881 [INFO ] [main] liquibase.changelog.ChangeSet - ChangeSet classpath:db/changelogs/db.changelog-2018-06-04 15-08-postgresql.xml::1528117671-3::test ran successfully in 9274ms

as you can see just for this case run successfully pass from 20ms to 9274ms!! if i add all other i pass to 20minutes.
In 3.8.0 i see many ```liquibase.snapshot.DatabaseSnapshot``` that i don't see before

I don't see anything in changelog that can explain this? can i deactivate something in this version?

thanks for your help

 

 

#EDIT1

 

After more investigation, problem is only on preconditions whith <not><foreignKeyConstraintExists> or <not><primaryKeyExist>… all other changeset work fine. My database have about 500 tables and i see many loop with include field that seem to be not concern by this precondition. Why do you need to get all datatable fields? because in my foreygnkey constraint i set foreignKeyTableName so just check on this table no?

 

thanks for your explication…

Environment

Java 8- Maven - spring - postgresql 9

Activity

Show:
Florian Grolleau
November 29, 2019, 4:42 PM
Edited

Hello

After debugging few hours. Slowness seems to be related to ColumnSnapshotGeneratorPostgres which is applied even when we are checking index presence.

ColumnSnapshotGeneratorPostgres overrides the getPriority method in charge of returning if generator should be used. There is no control to check if the object type we want to snapshot is assignable from Column type.

Is there any reason why there is no control on type ?

Reporter

Pierre-Alexandre Mancaux

Affects versions

Priority

Blocker
Configure