Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

Performance issue if a changeset contain a single insert statement with multiple values.

$
0
0
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 
  1. insert into mytable (col1, col2) values 
  2. ('val1', 'val2'),
  3. ('val3', 'val4'),
  4. ('val5', 'val5'),
  5. ...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
  1. 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. 

Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>