Hi Chris,

thanks for the info. My tables won’t have many rows and I don’t have the time 
for optimazation, especially if it is not necessary, but I will keep your words 
in mind!

Cheers
Ivo


On 02.02.2011, at 06:10, Chris Matthews wrote:

> Hi Ivo,
> 
> SQL is like regular expressions. You can go complex (with one mega 
> query/expression) but it could create a maintenance nightmare. See if you 
> cannot simplify the query into multiple queries and a bit of code (for loops 
> and using the joining columns) to lash them together. The code sequence 
> should be such that you limit access to a huge amount of rows; so you filter 
> the data accessed. It is usually easier to debug as well. And using Tom's 
> advice (EXPLAIN SELECT ...) on smaller join queries is often more useful 
> (than the explain on a mega join query).
> 
> In my experience it often runs way faster if the query is simplified.
> 
> Regards
> Chris
> -----Original Message-----
> From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
> Behalf Of Ivo Brodien
> Sent: 01 February 2011 23:49
> To: django-users@googlegroups.com
> Subject: Re: Django SQL Query does not stop
> 
> I found a solution be changing the MySQL server setting 
> optimizer_search_depth to 3 (default 62)
> 
> http://dev.mysql.com/doc/refman/5.0/en/controlling-optimizer.html
> http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_optimizer_search_depth
> 
> My query had over 20 INNER JOINTS and it made the optimizer search a long 
> process.
> 
> So at the moment a value of 3 is fine.
> 
> On 01.02.2011, at 21:20, Ivo Brodien wrote:
> 
>> The Change List that I am calling is a Intermediate Table if that is of any 
>> interest.
>> 
>> Is it possible that there is some sort of circular inner joints or something?
>> 
>> 
> 
> -- 
> 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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 
> -- 
> 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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
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 
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