Hi list

Using David Cramer's really nice replacement devserver
(http://github.com/dcramer/django-devserver), I noticed a bunch of
huge queries in some table generation code. Example:
http://dpaste.com/156907/
This is from one of my smallest tables, bigger ones with 120+ish rows
can take multiple ms to query.

I narrowed it down to a SomeModel.some_reverse_foreignkey.exists().
Using something as simple as .only("id").exists() will make the query
several dozen times faster.

Is this a bug, or am I missing something in exists() behaviour? From
what I understood, it's supposed to be faster than count() in
situations where I just need to know whether there are rows present.

Using psycopg2 with postgresql 8.4.


J. Leclanche / Adys

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to