performance tuning – Typical time for JDBC import in a Postgresql Database


I need to import data from 70 XML files into a Database.

In the past I converted the XML files with a XSLT into SQL INSERT statements and imported them with psql. This had some limitations (error handling) but was quite fast.

Now I wrote a Java program to import the data. I imported 327828 rows in 70 transactions. PgAdmin4 reports after the import, that the database size is 210 MB and the XML data was 250 MB.

But the whole import took over 5 hours. This seems very slow to me. I do not understand how it is possible to spend more than 5 hours on 210 MB data. But I do not have any empirical values either.

How can I find out, if the time, the import took, is the normal behavior for a JDBC import? Is it possible to profile the import either on the database side or the client side to find any bottlenecks? Is it possible to do some kind of speed test to qualify my database setup?