On Thu, Dec 06, 2001 at 09:28:10AM +0000, Chris Withers wrote: > neeraj arora wrote: > > > Already spent a week figuring how to get the SELECT to work fast when a few > results are returned, os all appropriate columns are indexed ;-) > > > u can find more on this page > > http://www.linux-mag.com/cgi-bin/printer.pl?issue=2001-06&article=mysql > > i hope this will help you. > > Yup, had a good read...
Glad you liked it. :-) > My specific problem isn't with indexing as such, I reckon I have > prettymuch optimal indexes for the SELECTs I'm doing, but I have > problem when _lots_ of results are returned. Ah, that's a different problem alright. SQL_BUFFER_RESULT (http://www.mysql.com/doc/S/E/SELECT.html) my help, depending on what the real bottleneck is. > Is there any efficient way I can just get the count of rows returned > by a SELECT rahter than making MySQL go through all the hassle of > generating all the results and returning them to me? Sure, change your SELECT * FROM foo WHERE ... to SELECT COUNT(*) FROM foo WHERE ... to get the cound of matching rows. 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 7 days, processed 157,472,311 queries (257/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