Search code examples
multithreadingpostgresqldatabase-administration

Paralle backup threads in postgres


I am taking dump of tables with pg_dump and using option -j and directory format for parallel backups. I have only 2 tables and giving -j 8, means 8 parallel threads. I just want to confirm if all 8 threads will contribute in taking backup of 2 tables or only 2 threads will work and others will remain idle? Crux of question is : If it is one thread for one table or all threads for as many table as we mentioned in command?


Solution

  • Only one thread can work on a single table (each table is backed up in its own file, and it would be difficult for two threads to write to the same dump file concurrently).

    So 6 of your 8 threads will be idle.