Re: how many records - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: how many records
Date
Msg-id 20030911015027.GA8580@wolff.to
Whole thread Raw
In response to Re: how many records  (Stuart Woodward <woodward@garage.co.jp>)
List 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 by date:

Previous
From: Stuart Woodward
Date:
Subject: Re: how many records
Next
From: "Derrick Betts"
Date:
Subject: Invalid Blob length