No, it should be and is scanning through the 500,000+ rows that meet the key of (approved, datestamp). The table has 1M+ in it. My question is, how can it be faster? Can it not be faster? Is MySQL on my size server just not going to handle scanning 500K rows? That seems like a low number to have problems with. The query is not just slow, it does not return.
Brian. ----- Original Message ----- From: "Thomas Spahni" <[EMAIL PROTECTED]> To: "Brian Moon" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, August 16, 2002 10:51 AM Subject: Re: Query slowing down, need advice | On Fri, 16 Aug 2002, Brian Moon wrote: | | > I ran into a problem when the queries started to call for 500,000+ rows. | > The query would not return. Here is the query and explain: | > | > select SQL_NO_CACHE id from single_table where approved='Y' AND datestamp >= | > '2001-08-16 00:00:00' AND ( ( author LIKE '%myphorum%' OR subject LIKE | > '%myphorum%' OR body LIKE '%myphorum%' ) ) order by datestamp desc; | | Brian, | | this query, having a joker at the beginning of each search string, scans | through the whole table. It can't possibly be fast on large tables. | | Regards, | Thomas | | --------------------------------------------------------------------- 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