Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2016-06-30 23:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (405 votes). Check out past polls.