Liquibase very slow to check that table does not exist on Oracle

Description

When using the tableExists precondition on an Oracle database, we observe a lag of 15-16s if the tables does not exist, whereas the precondition is quickly evaluated when the table does exist. Here is a (slightly anonymized) example from such precondition:

We have the use case that we work on a dynamic schema where certain tables may or may not exist, so we have to check roughly a dozen tables in this example. With just 6 tables missing, the application startup is taking 1.5 minutes longer, and this is not the worst case scenario ...

Another developer, James Clayton, also noted this behaviour and also seemingly found the root cause, as seen on his question on StackOverflow: Liquibase tableExists not scaling

Here is a liquibase log showing the differences in fast and slow checks:

 

Environment

Liquibase 3.8.5 (same for version 3.5.x already) with Oracle Server 11

Reporter

Matthias Basler

Components

Affects versions

Priority

Major
Configure