The value printed would be an ID, rather than a count (it's potentially expensive to calculate), so it could be much higher than the total number of rows. You should be able to see the max ID though.
Note that the ID actually refers to the attachment data ID rather than attachment IDs.