[EMAIL PROTECTED] wrote:
Jigal van Hemert <[EMAIL PROTECTED]> wrote on 11/02/2005 03:29:14 AM:
 > If I understand
 > http://dev.mysql.com/doc/refman/5.0/en/table-and-index.html
 > correctly, the index of the primary key is stored as the clustered index
 > together with the data. To me this means that there is no difference
 > between counting the primary key entries and counting the data entries.
>
That would be true if everyone could always see every record. However there could be several active copies (versions) of any record. Each copy would be part of a different transaction. How many records YOU can see can be very different than how many records I can see depending on what's going on in our respective transactions.

Sorry for the late reply, I had a day off.

I was talking about the difference between COUNT(*) and COUNT(<primary key field>); I don't think that there is a difference in speed if you take "snapshots" -- as InnoDB calls them -- into account. If the primary key and the record data are stored together both counts should be equally fast, no matter how many versions of a record exist.

Regards, Jigal.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to