Document admin dead-end

This commit is contained in:
Klaas van Schelven
2024-05-27 13:06:31 +02:00
parent e6d27e881f
commit 9f1be0b001

View File

@@ -9,6 +9,21 @@ from .models import Event
@admin.register(Event)
class EventAdmin(admin.ModelAdmin):
# A note on performance: when using this particular (list) admin on the playground (~150K events), I ran into the
# fact that it was unusably slow (at least more slow than 30s to render). I examined this for a while, but in the
# end the conclusion was: "this will simply never work". There's simply too much brokenness here. The admin works
# fine for the "scaffolding" case, and perhaps for things like users, projects etc, but for the "main event"
# (events) we'll have to build it ourselves. Regarding the brokenness, some thoughts/links:
#
# * arbitrary sorting is (multiple columns) is possible, which means you'll need arbitrary indexes
# * https://code.djangoproject.com/ticket/8408
# * https://github.com/django/django/blob/9a3454f6046b/django/contrib/admin/options.py#L1816
# no point of configuration for this one, I simply clobbered Django's code directly to turn it off
# * `actions_selection_counter = False` (possible to set as an admin option)
# * then I ran into the query itself just being super-slow (presumably caused by sorting)
# open question: when we'll "build this ourselves", is not some of the sqlite(?) slowness surfacing in other ways?
ordering = ['-timestamp']
search_fields = ['event_id', 'debug_info']