-
Enklast:lägg till
set synchronous_commit=offföre\i update.sql -
Bättre:
- Dela upp filen till delar av som 100 000 uppdateringar:
split -l 100000 -a 6 --additional-suffix=.sql update.sql update-part - Kör dessa uppdateringar parallellt, varje fil i en transaktion, till exempel med:
/bin/ls update-part*.sql \ | xargs --max-procs=8 --replace psql --single-transaction --file={}
- Dela upp filen till delar av som 100 000 uppdateringar: