Re: query help

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: query help
Дата
Msg-id 14293.1155216684@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: query help  (Brendon Gleeson <brendon@gleesonprop.co.za>)
Список pgsql-novice
Brendon Gleeson <brendon@gleesonprop.co.za> writes:
> ** apparently count(1) is faster  than count(*) and count(id), my Rails log
> confirms this, however I have a limited amount of records at the moment so
> benchmarks are properly inaccurate..

count(1) and count(*) are exactly the same thing (in existing PG
releases anyway), so whatever you're looking at is measurement noise.
count(id) would properly be slower because of the need to examine the
field to see if it's null.

            regards, tom lane

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

Предыдущее
От: Brendon Gleeson
Дата:
Сообщение: Re: query help
Следующее
От: "Andrej Ricnik-Bay"
Дата:
Сообщение: Re: ident authentication failed for user postgres.