tag:blogger.com,1999:blog-12330530.post112564208722313953..comments2023-10-29T16:29:37.403+05:30Comments on Rajneesh's Logbook: SELECT COUNT(*) Vs SELECT COUNT(COLUMN_NAME)Unknownnoreply@blogger.comBlogger5125tag:blogger.com,1999:blog-12330530.post-11525511465929922252008-02-07T08:37:00.000+05:302008-02-07T08:37:00.000+05:30in SQL Server 2005, it used to be the same, but wh...in SQL Server 2005, it used to be the same, but when i tried it with 10 million records, COUNT(column_name) is faster by 1 second. weird...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-12330530.post-35017672713897459542007-05-19T02:11:00.000+05:302007-05-19T02:11:00.000+05:30In MySQL, COUNT(*) is faster than COUNT(column_nam...In MySQL, COUNT(*) is faster than COUNT(column_name).Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-12330530.post-1125763270649046642005-09-03T21:31:00.000+05:302005-09-03T21:31:00.000+05:30If select count(1) vs. count(*) is your performanc...If select count(1) vs. count(*) is your performance bottleneck, you are very lucky indeed :)<BR/><BR/>(of course, you don't want to do something "slower" if you know of a better way).Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-12330530.post-1125675235251877562005-09-02T21:03:00.000+05:302005-09-02T21:03:00.000+05:30SELECT COUNT(*) used to be much faster in hsqldb, ...SELECT COUNT(*) used to be much faster in hsqldb, although now they have fixed that. Those kind of optimizations can I think only be considered after appropriate testing. It varies from DB vendor to DB vendor and from version to version.Fabienhttps://www.blogger.com/profile/07288327695801480778noreply@blogger.comtag:blogger.com,1999:blog-12330530.post-1125663270823338132005-09-02T17:44:00.000+05:302005-09-02T17:44:00.000+05:30If u go thro the entry, u would find it also talk ...If u go thro the entry, u would find it also talk of SELECT COUNT(1) and SELECT COUNT(ROW_ID) as well :)<BR/>Do u have an openion on Databases other than Oracle?Rajneesh Garghttps://www.blogger.com/profile/13991782931724290894noreply@blogger.com