Re: Out of free buffers... HELP!

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Out of free buffers... HELP!
Дата
Msg-id 1701.1000968954@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Out of free buffers... HELP!  ("Diehl, Jeffrey" <jdiehl@sandia.gov>)
Список pgsql-sql
"Diehl, Jeffrey" <jdiehl@sandia.gov> writes:
> Ok, can someone explain to me why this first query might run faster than the
> second?
> select src,dst,count(dst) from data;
> select src,dst,count(*) from data;

Hmm, I'd expect the second to be marginally faster.  count(*) counts the
number of rows matching the WHERE condition; count(foo) counts the
number of rows matching the WHERE condition for which foo is not NULL.
So count(foo) ought to involve a couple extra cycles to test for
non-NULL-ness of the specified field.  But it's hard to believe you
could measure the difference --- what results are you getting?
        regards, tom lane


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

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: Out of free buffers... HELP!
Следующее
От: Haller Christoph
Дата:
Сообщение: Re: Registring a C function in PostgreSQL II