I would like to accelerate loading data to PostgreSQL. I started using the pgloader https://github.com/dimitri/pgloader and wanted to utilize parallel loading. I was tinkering with different parameters but I couldn't activate more than two cores on my machine (which has 32 of them). I found the documentation https://github.com/dimitri/pgloader/blob/master/pgloader.1.md and tried to set the batch options which were described there. Currently, I have these settings:
LOAD CSV
FROM '/home/data1_1.csv'
--FROM 'data/data.csv'
INTO postgresql://:postgres@localhost:5432/test?test
WITH truncate,
skip header = 0,
fields optionally enclosed by '"',
fields escaped by double-quote,
fields terminated by ',',
batch rows = 100,
batch size = 1MB,
batch concurrency = 64
SET client_encoding to 'utf-8',
work_mem to '10000MB',
maintenance_work_mem to '20000 MB'