Re: how many records

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: how many records
Дата
Msg-id 20030911015027.GA8580@wolff.to
обсуждение исходный текст
Ответ на Re: how many records  (Stuart Woodward <woodward@garage.co.jp>)
Список pgsql-novice
On Thu, Sep 11, 2003 at 10:20:23 +0900,
  Stuart Woodward <woodward@garage.co.jp> wrote:
> > Bryan Irvine wrote:
> > Is there an easy way to count how many records there are?
>
> On Wed, 10 Sep 2003 18:26:30 +0100
> Simon Willison <cs1spw@bath.ac.uk> wrote:
>
> > Yes, using count(*):
> > select count(*) from tablename;
>
> Is there any performance difference in explicitly naming a column to
> count?
>
> i.e select count(id) from tablename;

Note that select count(id) and select count(*) can return different numbers.
Select count(*) is equivalent to select count(1) and I believe that
transformation (or something equivalent) is made by postgres.

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

Предыдущее
От: Stuart Woodward
Дата:
Сообщение: Re: how many records
Следующее
От: "Derrick Betts"
Дата:
Сообщение: Invalid Blob length