Re: table row count

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: table row count
Дата
Msg-id 20030209062412.GA17498@wolff.to
обсуждение исходный текст
Ответ на table row count  ("Martin Hurst" <martinh@ix.netcom.com>)
Список pgsql-general
On Sun, Feb 09, 2003 at 00:08:59 -0500,
  Martin Hurst <martinh@ix.netcom.com> wrote:
> Is there a way to get the row count of a user table without doing the?
>
> select count(*) from <table>
>
> which can take some time and even do a table scan if the table has millions
> of rows in it.
>
> Are there any system tables or views that hold this value for any given user
> table?

No. If you are going to do lots of counts relative to inserts and deletes,
you can keep the count in another table and create triggers to update it.

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

Предыдущее
От: "Martin Hurst"
Дата:
Сообщение: table row count
Следующее
От: Tom Lane
Дата:
Сообщение: Re: table row count