Admin List Widgets Need To Be Paginated
|Reported by:||gabreyla@…||Owned by:||nobody|
|Severity:||Normal||Keywords:||Admin, Lots of Data, Paginated Widgets|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I connected the Django ORM to an existing postgresDB (which we used to use sqlAlchemy to manage/use) and has a lot of data in it. Some tables have upward of half a million rows.
The Django Admin works fine when listing the objects in a table (ei: /admin/users) and it's quite snappy because it only displays 100 objects at a time (the list view is paginated)
But then when I inspect one of the objects (ei: /admin/users/1) then a very lengthy query starts to join and list all items in tables that have a relationship with this object. This happens because some of the admin widgets are not paginated and would want to display all .5 million objects in that single widget. The query is usually too long and the request times out. Usually it times out even earlier at around 100k rows. (1 foreignKey relationship to a 100k table takes 512 seconds, verified using Django-debug-toolbar)
It's quite insane for widget to display all of that info just as much as it's crazy to expect the user to browse (by means of a scrollbar) 100k-1M rows.
The current widgets used in the Admin are "good defaults" for small tables, but *not* good defaults for the general case.
I think that a lot of pain could be avoided for a lot of people if the default widgets used in the Admin were paginated as well just like the list views of the Admin is.
Change History (6)
comment:1 Changed 8 months ago by gabreyla@…
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:4 Changed 7 months ago by timo
- Resolution set to worksforme
- Status changed from new to closed