I want to know just for curiosity that, does Select Count(*) from SomeTableName
also traverses all the rows of the database as that of Select * from SomeTableName
?
Or is there any other count field available in database's metadata that updates itself each time a row is added or deleted? And that field is accessed by the former query.
Also I want to know that which of the both queries is faster and how much?
count(*)
is fine,select *
is not