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.