Each night, I plan to update some tables, based on values in other tables, in batch. I guess I need something like 5000 queries for this.
First question is: does anybody know how long this will take? Db=postgres.
Next to that, to prevent data-loss because of this operation, I would like to backup all tables first (unless somebody has a better idea) and restore them if the code encounters any problem.
Second question : does anybody know how long this could take, having something like 2000 rows in each of 3 tables?
Last, and most important question, what would be the best way to do it? Like I said, I plan on making a backup and the processing the original tables. Do I have to lock all tables during the process? Or would I rather copy all tables, do the processing and next restore the newly created tables?