On Tue, Jan 22, 2002 at 10:12:55AM -0600, Solsberry, Glendon wrote: > I have mySQL v3.23 running on a Mandrake 8.1 box (AMD 1600XP, 512MB > RAM). The problem is that the main query (listed below) takes > approximately 3 hours to run.
[snip] Wow! Thanks for all the detail. > The query is this: > SELECT SQL_BIG_RESULT tblNew.username, (tblNew.wucount - > tblMain.wucount), tblNew.wucount, tblMain.wucount FROM tblNew LEFT OUTER > JOIN tblMain ON (DATE_SUB(tblNew.lastupdate, INTERVAL $hourssinceNoon > HOUR) = tblMain.lastupdate) ORDER BY tblNew.wucount DESC > Where $hourssinceNoon is the number of hours since noon yesterday. > > tblNew typically has approximately 4500 records in it. tblMain has > records added every 4 hours, which is all the records from tblNew. Can you show us the output of EXPLAIN on that query? That may help figure this out. Jeremy -- Jeremy D. Zawodny, <[EMAIL PROTECTED]> Technical Yahoo - Yahoo Finance Desk: (408) 349-7878 Fax: (408) 349-5454 Cell: (408) 685-5936 MySQL 3.23.41-max: up 22 days, processed 513,761,222 queries (265/sec. avg) --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php