At 09:46 AM 5/3/2002, you wrote: > > Nope. :) > > The table could be in excess of 1 million rows. The > > user sees just the > > first 100 rows no matter what. If he wants to see a > > different group of > > records he can use the search fields at the top of > > the form. I want the web > > server to serve as many pages/sec as possible and > > limiting the # of rows > > returned to 100 (or less) is the best way to do it. > > If everyone started to > > do 1 million row queries, then it won't support many > > users. > > > >I think that mysql selects all row regardless of LIMIT > >So although it returns only 100 - I would think >there's a better way to do it. > >olinux
olinux, If there is a better way, I'm all ears. :) (Cursors might be an option but they aren't available yet until 4.1/4.2) LIMIT 100 does work extremely fast on large tables provided that if any sorting is done, the sort column is indexed. If they aren't indexed, then MySQL will need to fetch all the rows to sort them. I think this is what you were referring to. Other than that, I think LIMIT is the solution. Unless someone out there can come up with something better for a webserver running PHP. Mike sql,query --------------------------------------------------------------------- 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