It's just that the number of rows in a table is stored directly in the .MYD file (I believe) so a query like "select count(*) from table" will just return that value, rather than counting all the rows. It's not that the functions are "built-in", rather they're *optimized* - a totally different thing.
Dean. > -----Original Message----- > From: JamesD [mailto:[EMAIL PROTECTED]] > Sent: Saturday, 21 December 2002 7:33 pm > To: [EMAIL PROTECTED] > Subject: RE: Can MySQL handle 120 million records? > > Jeremy, > > if i run the command > > show tables; on some database > it returns > > "5 rows in set (0.02 sec)" > > and if, on the same database i run > the command > > select count(*) from 'table'; > it returns > > +---------+ > | count(*)| > +---------+ > | 47226322| > +---------+ > 1 row in set (0.00 sec) > > now, i believe its reasonable to assume > a CPU must spend more time to count 47 million records, > than to count 5 tables. This is why I believe > that many common selects are built-in to mysql in the code > somewhere. make sense? Its a good idea actually, that building > in commonly run selects when the process is idling and stuffing > results into variables that can be called in an instant, saves > us all time and money... > > Jim > > > -----Original Message----- > From: Jeremy Zawodny [mailto:[EMAIL PROTECTED]] > Sent: Friday, December 20, 2002 3:28 PM > To: JamesD > Cc: [EMAIL PROTECTED] > Subject: Re: Can MySQL handle 120 million records? > > > On Wed, Dec 18, 2002 at 08:05:46PM -0800, JamesD wrote: > > > > i like mySQL, but it has a long way to go to gain the level of > > 'confidence' that oracle, db2 or mssql or sybase have when it comes > > to frontline mission critical stuff. > > Can you explain why? > > > I think it will in time...thats why i stick with it. besides, > > confidence is often just a synonym for 'knowledge' > > Really? I tend to see it more like confidence builds with experience > (and therefore time). You don't need to know a lot about to become > confident in its operation. Many of us don't *really* understand how > gravity works, but we're quite confident in it. > > > select count(*) from x (0.00 seconds) > > > > if you dig into the source, you will probably find this common > > select is built in and running all the time, > > > > and we are all just getting a pre-filled variable > > returned from the method " select count(*) from (x) " > > Please find it. I'll bet you money that it's not. > > > I hope someone can prove me wrong... > > I think the burden of proof is on you. > > Jeremy > -- > Jeremy D. Zawodny | Perl, Web, MySQL, Linux Magazine, Yahoo! > <[EMAIL PROTECTED]> | http://jeremy.zawodny.com/ > > MySQL 3.23.51: up 5 days, processed 219,909,773 queries (441/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 <mysql-unsubscribe- > [EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > > --------------------------------------------------------------------- > 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 <mysql-unsubscribe- > [EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- 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