| От | Tom Lane |
|---|---|
| Тема | Re: Database I/O and other performance questions. |
| Дата | |
| Msg-id | 24829.977591175@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Database I/O and other performance questions. (Lincoln Yeoh <lyeoh@pop.jaring.my>) |
| Список | pgsql-general |
Lincoln Yeoh <lyeoh@pop.jaring.my> writes: > would/should select count(*) be slower than select > count(averysmallcolumnmaybeboolean) There is actually a semantic difference there, see http://www.postgresql.org/devel-corner/docs/postgres/sql-expressions.htm#SYNTAX-AGGREGATES count(*) means the count of selected rows, but count(foo) means the number of selected rows where the variable or expression is not NULL. count(*) should be a fraction faster, because it doesn't expend any cycles to check whether the specific column is NULL. The "*" in this syntax doesn't mean "all columns" the way it does in a select list, it's just a dummy. regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера