PostgreSQL, Foreign Keys, Insert speed & Django
- by Miles
A few days ago, I ran into an unexpected performance problem with a pretty standard Django setup. For an upcoming feature, we have to regenerate a table hourly, containing about 100k rows of data, 9M on the disk, 10M indexes according to pgAdmin.
The problem is that inserting them by whatever method literally takes ages, up to 3 minutes of 100%…