Re: Count(*) Question

Поиск
Список
Период
Сортировка
От Joel Burton
Тема Re: Count(*) Question
Дата
Msg-id JGEPJNMCKODMDHGOBKDNGEFBCMAA.joel@joelburton.com
обсуждение исходный текст
Ответ на Re: Count(*) Question  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: Count(*) Question  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
> >     I was reading through the Rules section of the online docs,
> and noticed the
> > following note: (* is just an abbreviation for all the
> attribute names of a
> > relation. It is expanded by the parser into the individual
> attributes, so
> > the rule system never sees it.)
> >     Does this mean that count(*) may return less than the total
> number of
> > records if all the fields in a record are NULL?
>
> Yes, I beleive so.
>
> >     If this is true, is there a better way to get a count of records?
>
> I think count(1) is the common suggestion.

Interesting. In 7.3devel, it does not fail to count the completely-null rows
in count(*). Does it actually do this for any version?


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

Предыдущее
От: "Peter Darley"
Дата:
Сообщение: Re: What popular, large commercial websites run PostgreSQL?
Следующее
От: Ron Snyder
Дата:
Сообщение: Re: Fwd: Postfix Relay Hub SMTP server: errors from pos