I have an administrator view that contains four foreign keys, each of which contains several thousand entries. It slowly appears in the browser.
If I change the django model to exclude selection fields by adding raw_id_fields, everything will become nice and fast. Thus, the slowness is due to a set of selective drops, and this is a known problem, because that is why raw_id_fields exist.
I would like to understand what causes slowness. On the server, if I make an SQL query for the data that is used to populate the selection fields, the results are instantaneous. Therefore, Postgres retrieves or sorts data is not the cause.
Perhaps this is the time required to transfer the data filling in the drop-down lists? Or is it something that django does?
Mitch source
share