Re: select items, and max id

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: select items, and max id
Дата
Msg-id 20030829025707.GE4373@wolff.to
обсуждение исходный текст
Ответ на Re: select items, and max id  ("Luis H." <pgsql-novice@geekhouse.no-ip.com>)
Список 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 по дате отправления:

Предыдущее
От: "Luis H."
Дата:
Сообщение: Re: select items, and max id
Следующее
От: Nabil Sayegh
Дата:
Сообщение: Re: select items, and max id