Обсуждение: where is pg_stat_activity (and others) in the documentation?

Поиск
Список
Период
Сортировка

where is pg_stat_activity (and others) in the documentation?

От
Willy-Bas Loos
Дата:
Hi,

I can't find pg_stat_activity in the the documentation.
There are many pg_stat_xxx tables and views, but their columns are not described, or so it seems.
Maybe that is a bug in the documentation, then.

I was looking for what exactly "waiting" means in pg_stat_activity. In the 9.0.1 documentation, it is mentioned that it shows the "waiting status" but that doesn't really help.
http://www.postgresql.org/docs/current/static/monitoring-stats.html#MONITORING-STATS-VIEWS

I was looking for the answer for postgresql version 8.3 (it might differ).

Cheers,

Willy-Bas Loos

--
"Patriotism is the conviction that your country is superior to all others because you were born in it." -- George Bernard Shaw

Re: where is pg_stat_activity (and others) in the documentation?

От
Vick Khera
Дата:
On Mon, Nov 15, 2010 at 5:15 AM, Willy-Bas Loos <willybas@gmail.com> wrote:
> I was looking for what exactly "waiting" means in pg_stat_activity.

waiting for a lock.

Re: where is pg_stat_activity (and others) in the documentation?

От
Scott Mead
Дата:


On Mon, Nov 15, 2010 at 10:03 AM, Vick Khera <vivek@khera.org> wrote:
On Mon, Nov 15, 2010 at 5:15 AM, Willy-Bas Loos <willybas@gmail.com> wrote:
> I was looking for what exactly "waiting" means in pg_stat_activity.


You can find out exactly what you're waiting for by correlating this to the pg_locks table.

  Grab the 'procpid' of your waiting query and run:

  select * from pg_locks where pid=<thepid> and granted='f';

  Notice, in the pg_locks table, the logic works slightly different... if you're 'waiting' (pg_stat_activity), then you haven't been 'granted' (pg_locks).


As far as documentation: http://www.postgresql.org/docs/current/static/monitoring-stats.html

--Scott
 

waiting for a lock.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: where is pg_stat_activity (and others) in the documentation?

От
Willy-Bas Loos
Дата:

You can find out exactly what you're waiting for by correlating this to the pg_locks table.
  Grab the 'procpid' of your waiting query and run:
  select * from pg_locks where pid=<thepid> and granted='f';
  Notice, in the pg_locks table, the logic works slightly different... if you're 'waiting' (pg_stat_activity), then you haven't been 'granted' (pg_locks).
Thanks.

I do think that we need per-column documentation of the Standard Statistics Views.
Would it be considered for the documentation if i give describing them a try?
If so, where do i send it ?

Cheers,

WBL

--
"Patriotism is the conviction that your country is superior to all others because you were born in it." -- George Bernard Shaw

Re: where is pg_stat_activity (and others) in the documentation?

От
tv@fuzzy.cz
Дата:
>> You can find out exactly what you're waiting for by correlating this to
>> the
>> pg_locks table.
>>   Grab the 'procpid' of your waiting query and run:
>>   select * from pg_locks where pid=<thepid> and granted='f';
>>   Notice, in the pg_locks table, the logic works slightly different...
>> if
>> you're 'waiting' (pg_stat_activity), then you haven't been 'granted'
>> (pg_locks).
>>
> Thanks.
>
>
>> As far as documentation:
>> http://www.postgresql.org/docs/current/static/monitoring-stats.html
>>
> I do think that we need per-column documentation of the Standard
> Statistics
> Views.
> Would it be considered for the documentation if i give describing them a
> try?

What's wrong with these docs?
http://www.postgresql.org/docs/9/static/catalogs.html

And when it comes to statistics views (pg_stat/pg_statio), don't forget
most of the columns correspond to a function - just display the view
definition and search for documentation for each function separately.

It'd be nice to have the documentation for each view too, not for each
function only, but on the other hand that would be redundancy.

Tomas


Re: where is pg_stat_activity (and others) in the documentation?

От
Tom Lane
Дата:
tv@fuzzy.cz writes:
>> I do think that we need per-column documentation of the Standard
>> Statistics Views.

> What's wrong with these docs?
> http://www.postgresql.org/docs/9/static/catalogs.html

Or, more to the point, these docs:
http://developer.postgresql.org/pgdocs/postgres/monitoring-stats.html#MONITORING-STATS-VIEWS

            regards, tom lane

Re: where is pg_stat_activity (and others) in the documentation?

От
Tomas Vondra
Дата:
Dne 17.11.2010 16:22, Tom Lane napsal(a):
> tv@fuzzy.cz writes:
>>> I do think that we need per-column documentation of the Standard
>>> Statistics Views.
>
>> What's wrong with these docs?
>> http://www.postgresql.org/docs/9/static/catalogs.html
>
> Or, more to the point, these docs:
> http://developer.postgresql.org/pgdocs/postgres/monitoring-stats.html#MONITORING-STATS-VIEWS

Yes, but that's just the general description of the views, including a
brief description of the columns. But sometimes it's difficult to see
which column is actually described and the description available for the
function is usually bit more detailed.

For example pg_stat_bgwriter view is described like this (quoting just
part of the description):

    One row only, showing cluster-wide statistics from the background
    writer: number of scheduled checkpoints, requested checkpoints, ...

That's a fair amount of information, but if you do

    \d+ pg_stat_bgwriter

you'll immediately see that checkpoints_timed corresponds to a call to
pg_stat_get_bgwriter_timed_checkpoints, and this is described like this

    Number of times the background writer has started timed checkpoints
    (because the checkpoint_timeout time has expired)

Which is a bit more detailed that the description of the view.

regards
Tomas

Re: where is pg_stat_activity (and others) in the documentation?

От
Willy-Bas Loos
Дата:


On Wed, Nov 17, 2010 at 2:55 PM, <tv@fuzzy.cz> wrote:
What's wrong with these docs?
http://www.postgresql.org/docs/9/static/catalogs.html
It's about different tables and or views

(Tom Lane):
>Or, more to the point, these docs:
>http://developer.postgresql.org/pgdocs/postgres/monitoring-stats.html#MONITORING-STATS-VIEWS

IMO, it is not a clear and detailed description of what the information in the views means.

And when it comes to statistics views (pg_stat/pg_statio), don't forget
most of the columns correspond to a function - just display the view
definition and search for documentation for each function separately.

You'd have to find out which column corresponds to which function, and then what that function does, to find out what the column means.
That is not my idea of documentation. 

It'd be nice to have the documentation for each view too, not for each
function only, but on the other hand that would be redundancy.

Well, of course the documentation is completely redundant in a way, because the source code is the best documentation.
We have the functions AND the views, so imho it would be good to document both.
Not everyone is so savvy that they look up what the built in views do exactly, and then understand.
Generally, (i presume) they are looking to solve a different problem or question and they look to these views to be informed. They are not necessarily into source code (or underlying sql source code).

What i think we need is something like this
http://www.postgresql.org/docs/9/static/catalogs.html
for the pg_stat* views

Cheers, have a nice day,

WBL

--
"Patriotism is the conviction that your country is superior to all others because you were born in it." -- George Bernard Shaw