Re: select items, and max id - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: select items, and max id
Date
Msg-id 20030829025707.GE4373@wolff.to
Whole thread Raw
In response to Re: select items, and max id  ("Luis H." <pgsql-novice@geekhouse.no-ip.com>)
List pgsql-novice
On Thu, Aug 28, 2003 at 22:46:26 -0400,
  "Luis H." <pgsql-novice@geekhouse.no-ip.com> wrote:
> Thanks for the info. I just realized I had thought out the logic of my web
> app in the wrong way. I will now be working with the number of items in the
> table. I know there is a count() query, and earlier someone asked for a
> better solution (that doesn't need to cycle through the table). Tom Lane
> mentioned pg_class.reltuples, but said it wasn't a completely accurate
> measure. Any suggestions?

If you need an exact number you either have to count the number of records
in the table that match your critera or you need to maintain counts
somewhere. The cost of maintaining the counts can potentially be high so
it won't necessarily be better to do it that way.

pgsql-novice by date:

Previous
From: "Luis H."
Date:
Subject: Re: select items, and max id
Next
From: Nabil Sayegh
Date:
Subject: Re: select items, and max id