When you need to fill data to null fields of multiple records, you had better avoid UPDATE. Rather:
- Prepare for a table to insert all the data to fill
- Use SELECT ~ OUTER JOIN to join with the original table
- And prepare for the "result" table to push the JOINed results via INSERT INTO.
I found out that I could finish the job in 5:35 when traditional UPDATE didn't finish in 10 minutes.
Tested under PostgreSQL 12.
No comments:
Post a Comment