Table.exists() very slow in Postgres Environments with a lot of objects #1701
Labels
Milestone
Comments
The code for |
Fixed by #1702 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Flyway are you using?
4.2.0
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks)
Java API
What database are you using (type & version)?
Postgres 9.5
What did you do?
Run migrations on a database with many objects.
Objects are all tables/indexes/sequences in all schemas.
What did you expect to see?
I expected a negligible overhead for the calls to Table.exists()
What did you see instead?
A single call to Table.exists() - or more precisely PostgreSQLTable.doExists() - has a significant overhead.
On a database with over 500.000 Objects a single call can take more than 250ms.
When calling Flyway.migrate() the method is called about 8 times and then 3 times per Script.
This might sum up to a huge overhead. Especially with a lot of schemas (which lead to the many objects).
Of course this is a problem with Postgres in the first place, but unfortunately leads to difficulties when doing migrations with Flyway .
The text was updated successfully, but these errors were encountered: