query is returning over 74,000 results and taking 30 seconds - HELP!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Guys,
 
I've tried several different things with the following 2 queries but
nothing seem to help. I've stared at the code and reworked it for hours
on end and frankly I am getting frustrated.
 
I'm only posting the queries themselves without the PHP code as the
entire section is quite long. If someone wants it I'd be more than happy
to post it as well.
 
ANY help or guidance is very much appreciated. I'm so far beyond
frustrated it isn't funny :-(
 
Thanks in advance.
 
Aaron
 
 
CODE:
 
 
$mQuery = db_query("SELECT DISTINCT manufacturer FROM kcs_threads ORDER
BY manufacturer");
while ($mResult = db_fetch($mQuery)) {
 
                //HTMl here
 
                $query = "select t.type, t.newUrlType, g.threadType,
g.groupName, g.groupNameUrl
                FROM kcs_threads t LEFT JOIN kcs_threadgroups g ON
t.type = g.threadType
                WHERE t.manufacturer =
".escapeQuote($mResult['manufacturer'])."
                ORDER BY t.type, g.groupName";
 
                $result = db_query($query);
 
                while($thread = db_fetch($result)) {
 
                                //If validations and HTML display here
 
                }
}
 

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux