Re: Surprising benchmark count(1) vs. count(*)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I will say I've seen count(1) in the wild a ton, as well as at my own company from developers who were used to it not making a difference.

There have been a couple queries in the hot path that I have had to changed from count(1) to count(*) as part of performance tuning, but in general it's not worth me worrying about. There are usually larger performance issues to track down in complex queries.

It would be nice if Postgres optimized this case though because it is really really common from what i've seen.

Thanks,
-Adam

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux