Hi everybody,

Today I was hunting down some serious performance problems in my app
and I found something pretty "confusing". I realized that, when
creating generic relations with the ContentTypes framework (http://
docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#id1) Django
does create a foreign key relationship on the content_type field,
which is normal, but, the field object_id not being related to any
other table, Django doesn't create any foreign key relationship for
this field.

This means that there won't be any index on that field and when
retrieving objects which are related to a generic item, the DBMS will
have to examine every row in the table, which is time consuming when
the table is getting big. To get rid of this problem, I'm forced to
use "db_index=True" on every object_id field, and I think Django
should do it automatically.
What do you think about that ?

BTW, congrats for the 1.0 release, that's awesome !
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to