| От | Laurenz Albe |
|---|---|
| Тема | Re: Surprising benchmark count(1) vs. count(*) |
| Дата | |
| Msg-id | ab88db80f032933ff603d9d59745e8a09196bc1e.camel@cybertec.at обсуждение исходный текст |
| Ответ на | Surprising benchmark count(1) vs. count(*) (Thomas Kellerer <spam_eater@gmx.net>) |
| Ответы |
Re: Surprising benchmark count(1) vs. count(*)
|
| Список | pgsql-performance |
On Thu, 2019-09-19 at 12:09 +0200, Thomas Kellerer wrote: > https://blog.jooq.org/2019/09/19/whats-faster-count-or-count1/ > > Is there a reason why count(*) seems to be faster? "count(*)" is just the SQL standard's way of saying what you'd normally call "count()", that is, an aggregate without arguments. "count(1)" has to check if 1 IS NULL for each row, because NULL values are not counted. "count(*)" doesn't have to do that. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com
В списке pgsql-performance по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера