[ I realize what I am trying to do might be a prime example of abusing the 
admin. The real answer to my question might very well be: 'sorry - the 
admin is just not made for that', and that is fine. The main reason I am 
asking this is to learn more myself - and most importantly to rule out 
other problems in my setup ]


Hello;

I have a model with ~200000 records and growing (is that "much"?). I can 
visit the /admin/app/model/ url in the Admin and get a listing of all the 
records/instances - but when I click on one of the actual instance - i.e. 
something /admin/app/model/12345/ the application times out (30 seconds on 
Heroku). The model in question is quite simple:

model A:
    foreignKey( B )
    foreignkey( C )
    float( )

model B
    foreignkey( D )
    foreignkey( D )
    foreignkey( E )

The relationship between A and B is 'nearly' one-to-one; i.e. there are 
roughly as many rows of A as there rows of B (The B model is currently not 
in the admin). For the other model C.D,E,.. the relationship is extremely 
'many-to-few' - i.e. the database only contains a handful of C,D,E, 
instances. I was wondering if something like prefetching foreign keys??? 
brought the whole thing to its knees?


The site is actually mainly an API - and the model in question is also 
exposed through a Django Rest Framework (DRF) endpoint:

List view - times out: https://friskby.herokuapp.com/sensor/api/datavalue/

One element - OK: https://friskby.herokuapp.com/sensor/api/datavalue/10000/


So - for the DRF configuration the situation is actually opposite; 
accessing the whole list times out (I have not done anything to configure 
pagination - so this might be OK?); whereas fetching one element is snappy. 
The admin site is password protected - but it only contains test-data and I 
would be happy provide login details if someone want's to take a look.

If someone can shed some light on this I would be very grateful.

Joakim


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4c31c348-4207-4afa-916b-2df79decff09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to