I have a CSV file which is approx 350GB. It is stored on the postgres server. I am attempting to copy it to a table in my DB using:
COPY <table_name>(<column1>, <column2>,...)
FROM '<CSV_location>'
DELIMITER ','
CSV HEADER;
The only indexing occuring is a primary key on one of the columns.
I am uncertain of the progress however the table is currently approx 150GB. It has taken around 5 days, and it seems nowhere near completion.
What could be the issue here?
UPDATE Two issues that I have come across and resolved.
Database storage path was incorrect and the volume was very close to capacity or had already reached it (99% full - 6GB left). I am not sure why I was not getting any notification of this. I have since changed the storage path to a new one with much more availible capacity.
I am no longer applying the primary key constraint on the hash column during table creation or pre copying of data. The copying of the data seems to take significantly longer when doing this.
It took approx 1 hour to copy the 350GB of CSV data to the DB and hundreds of millions of rows, without any primary key index.