I have an admin view which contains four foreign keys each with a few thousand entries. It is slow to appear in the browser.
If I change the django model to eliminate the select boxes by adding raw_id_fields things become nice and snappy. So the slowness is due to the population of the select drop downs and also this is a known issue since that is why raw_id_fields exists.
I'd like to understand what is causing the slowness. On the server, if I do a SQL query for the data which are used to populate the select boxes, results are instantaneous. So Postgres retrieving or sorting the data is not the cause.
Maybe it is the time it takes to transfer the data populating the drop downs? Or is it something that django is doing?