I have been assigned to prepare a checklist for my project. So, while compiling a checklist for SQLs, I suggested to use
I dont know how different DBs behave in this matter?
What u guys think of it? What are ur experiences?
SELECT COUNT(COLUMN_NAME) FROM TABLE
[COLUMN_NAME is NOTNULL column] instead of SELECT COUNT(*) FROM TABLE
My impression was that while for COUNT(*), DB has to do a complete scan of the table, for COUNT(COLUMN_NAME), it require to scan the COLUMN only. But then, I dont know why, I just decided to google it. And I came across this AskTom Entry where it says it is just a myth that COUNT(COLUMN_NAME) is faster than COUNT(*).I dont know how different DBs behave in this matter?
What u guys think of it? What are ur experiences?
Comments
Do u have an openion on Databases other than Oracle?
(of course, you don't want to do something "slower" if you know of a better way).