I try to find the best scenario to update or insert 1 million contacts in my postgres database.
My actual scenario is:
- read contacts 1000 per 1000 and try to insert multiple rows with one request
- if my request fails, I go line per line to insert or update my 1000 contacts
It takes 7 minutes for 50K lines.
What is the best scenario to perform my update or insert?