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

Поиск
Список
Период
Сортировка
От Adam Brusselback
Тема Re: Surprising benchmark count(1) vs. count(*)
Дата
Msg-id CAMjNa7ftSKUFp4SO07ctTqBsQ5s7TjA89UFe_j1LON82b-oN0A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Surprising benchmark count(1) vs. count(*)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Surprising benchmark count(1) vs. count(*)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
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

В списке pgsql-performance по дате отправления:

Предыдущее
От: Luís Roberto Weck
Дата:
Сообщение: Re: Slow query on a one-tuple table
Следующее
От: Luís Roberto Weck
Дата:
Сообщение: Re: Slow query on a one-tuple table