On Wed, Dec 30, 2009 at 7:15 AM, Adam Playford <adam.playf...@gmail.com>wrote:

> I'm not an expert on this, but a few thoughts.
>
> First, if I'm reading your message right, it sounds like your problem
> probably isn't with the query, but with how many times you're running
> it.


I'll echo that... the problem is not the database - the queries are as good
as it gets.  The problem is running them repeatedly.

If all else fails, I'd replace those queries that execute 500 times with raw
SQL that uses the IN operator to get the required rows.

E.g.: SELECT `common_addresstype`.`id`, `common_addresstype`.`adrtype` FROM
`common_addresstype` WHERE `common_addresstype`.`id` IN (1,6,8,52,173)

I imagine there's an ORM query that will do the same thing, but I know MySQL
far better than I know Django.

Nick

--

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


Reply via email to