We can use either count(<column_name>) or system tables to get the number of rows in a table.
Then where to use which one?
Thanks
Devi
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When
COUNT(*)(without anyWHEREconditions) starts to take more than about 10 seconds, that’s when I usually cancel the query, and start using the system tables from then onwards. Obviously, if there areWHEREconditions, then you can only obtain the answer viaCOUNT(*)(orCOUNT(<column>))Once a table is large enough that
COUNT(*)isn’t performing well, you don’t generally need an exact answer anyway.