You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, to check if a table is empty, Liquibase is using JdbcExecutor.queryForInt(..), which isn't efficient for tables with a large number of rows. Furthermore, if a table contains more rows than the maximum Integer number, the run will fail with an exception.
Steps To Reproduce
Create a changeSet that includes the TableIsEmpty precondition, which will call the check function in the RowCountPrecondition class.
If the table that the changeSet is being applied to has over Integer.MAX_VALUE rows, the run will fail with an exception.
Expected/Desired Behavior
The method for checking if a table is empty should be something similar to checking if there is a first row or not, instead of counting all of them and seeing if the number of rows is 0.
Liquibase Version
All
Database Vendor & Version
All
Liquibase Integration
All
Liquibase Extensions
No response
OS and/or Infrastructure Type/Provider
No response
Additional Context
No response
Are you willing to submit a PR?
I'm willing to submit a PR (Thank you!)
The text was updated successfully, but these errors were encountered:
Search first
Description
Originally metioned here.
Currently, to check if a table is empty, Liquibase is using
JdbcExecutor.queryForInt(..)
, which isn't efficient for tables with a large number of rows. Furthermore, if a table contains more rows than the maximum Integer number, the run will fail with an exception.Steps To Reproduce
Create a changeSet that includes the TableIsEmpty precondition, which will call the
check
function in the RowCountPrecondition class.If the table that the changeSet is being applied to has over Integer.MAX_VALUE rows, the run will fail with an exception.
Expected/Desired Behavior
The method for checking if a table is empty should be something similar to checking if there is a first row or not, instead of counting all of them and seeing if the number of rows is 0.
Liquibase Version
All
Database Vendor & Version
All
Liquibase Integration
All
Liquibase Extensions
No response
OS and/or Infrastructure Type/Provider
No response
Additional Context
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: