Liquibase 4.26 while importing the csv file it's taking long time

22 Views Asked by At

I recently upgraded Liquibase from version 3.5.0 to 4.24.0 and am facing performance issues when loading data into a table. The data loading process, which was previously efficient, is now significantly slower. I am using Liquibase to load a CSV file with 40,000 rows into a MySQL database.

Here's the changeSet I'm using:

<changeSet id="5.3.1" author="siddharth" runInTransaction="true">
    <comment>Create zip_codes table</comment>
    <createTable tableName="zip_codes">
        <column name="uid" type="BIGINT(20) UNSIGNED" autoIncrement="true">
            <constraints primaryKey="true" nullable="false" />
        </column>
        <column name="zip_code" type="VARCHAR(15)">
            <constraints nullable="false" unique="true" />
        </column>
        <column name="longitude" type="DECIMAL(9,6)" />
        <column name="latitude" type="DECIMAL(9,6)" />
        <column name="created_at" type="DATETIME" />
        <column name="updated_at" type="DATETIME" />
    </createTable>
    <comment>Load zip_codes table</comment>
    <loadData tableName="zip_codes" file="db/changelog/data/db.changelog-5.3.1-zip-code-data.csv" quotchar='"'>
        <column name="ZIP_CODE" type="STRING" />
        <column name="LONGITUDE" type="NUMERIC" />
        <column name="LATITUDE" type="NUMERIC" />
        <column name="CREATED_AT" type="DATE" />
        <column name="UPDATED_AT" type="DATE" />
    </loadData>
    <rollback>
        <dropTable tableName="zip_codes" />
    </rollback>
</changeSet>
0

There are 0 best solutions below