Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Re: Re: How to count rows using DBI & mysql - Performance results

by elwarren (Curate)
on Jun 11, 2001 at 22:45 UTC ( #87616=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: How to count rows using DBI & mysql - Performance results
in thread How to count rows using DBI & mysql - Performance results

Good point. I'm not sure how intelligent MySQL is, but the optimizer in Oracle will make this choice.

If you submit a count(*) query on a table with a primary key, it will use the index to generate the count instead of actually counting all the rows in the table.

The same holds true when doing a count(colname) and an index exists on that column.


Comment on Re: Re: Re: Re: How to count rows using DBI & mysql - Performance results

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://87616]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-07-26 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls