SQL native question - count rows

Hi,

I want do count the number of total comments that I have in a table. In that table all the rows have a different id... so if I perform the SQL question as "count(*) from t" or "count(1) from t" or "count(distinct comment.id from t"... all the options give me that the number as result.

My question is:
What is the sql query that have the best perform to execute?

Thanks

Hi @renatojmsantos
It's really hard to say, since you're leaving out a lot of details, like you have t in your from-clause, but counting distinct values of comment.id.
I would recommend that you search in a forum dedicated to your database or stackoverflow.com