Re: Why Select Count(*) from table - took over 20 minutes?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Why Select Count(*) from table - took over 20 minutes?
Дата
Msg-id AANLkTin+XdaRAd+D-3D3Uvj5Kd0gr8TfYn2oTfOHcpiT@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Why Select Count(*) from table - took over 20 minutes?  (Ozz Nixon <ozznixon@gmail.com>)
Список pgsql-general
On Thu, Oct 28, 2010 at 11:36 AM, Ozz Nixon <ozznixon@gmail.com> wrote:
> How/where do I query this?
>
> My script does not need a 100% accurate count - just a recently valid count - so I can verify the web crawlers are
stillcrawling :-) 

you can do this:
select reltuples from pg_class where relname = 'your_table' and relkind = 'r';

that will give you accurate count as of the last analyze, which is
going to be driven by table usage and/or manual analyze.   Probably
much better in your particular case is to do this:

select * from pg_stat_all_tables where relname = 'your_table';

and look at the n_tup_ins, del, etc.  and make sure they are changing
(those numbers are reset when server resets, fyi).

merlin

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

Предыдущее
От: ludwig@kni-online.de
Дата:
Сообщение: Re: PostGIS return multiple points
Следующее
От: "Daniel Verite"
Дата:
Сообщение: Re: Should PQconsumeInput/PQisBusy be expensive to use?