While working on my select_related changes, I noticed that the db backend was doing COUNT(*) for .count().. why?
I've changed it on my local copy to count the id column, but unless anyone can give me a specific reason, as far as I recall, it's faster to just count on the id column. On Dec 26 2006, 1:19 am, "Osso" <[EMAIL PROTECTED]> wrote: > I got the list wrong I meant: > > 1) GenericForeignKey doesn't work with select_related (instead of > GenericRelations). > I agree it can be tricky for queries with different types of related > objects. > It would be used for something like: > myfavorites = Favorite.objects.filter(user=me) > Then for each object in the list you display info about the > content_object. > We are using some .extra to simulate the select_related but I'd rather > have select_related() working. > > 2) I'd rather user related_table,related_object_id as they are more > precise. > I would expect a field named "content_type" to store the object content > type and not a related object content type. Same goes for object_id. > > 3) "You can't create objects using the generic key." I wanted to say > lookups: > As Tag.filter(content_object=myimage) doesn't work. > But in fact you can use image.tags.all() to get them. So it's fine. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---