I am currently on liquibase version 3.5.3. I have a .sql file with a changeset that contains a single "insert into table" statement with multiple values. i have observed that insert statements with multiple values work fine if they are not too large. but in my case i have a insert query inserting 6000 rows (apx. 700000 characters long query) within the single statement. like given below
- insert into mytable (col1, col2) values
- ('val1', 'val2'),
- ('val3', 'val4'),
- ('val5', 'val5'),
- ...and so on upto 6000 lines and total apx. 700000 characters.
above scenario takes atleast 80 seconds to execute the changeset. this is a problem for me since we have a timeout of 60 seconds in our cloud instance for any deployment to complete. i had debug the liquibase source code and identified that the below method is a culprit
- liquibase.util.StringUtils.processMutliLineSQL(String, boolean, boolean, String)
For now i had to split my insert statements to accomodate not more than 200000 characters in a single sql query. but this could again be a problem for me in future.