Re: RFC: replace pg_stat_activity.waiting with something more descriptive

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: RFC: replace pg_stat_activity.waiting with something more descriptive
Date: 2015-06-25 14:15:00
Message-ID: 20150625141500.GA12313@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-06-25 10:01:39 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > On 2015-06-25 16:26:39 +0530, Amit Kapila wrote:
> >> Won't leaving former contents as it is (until the next thing is being
> >> blocked) could give misleading information. Currently we mark 'waiting'
> >> as false as soon as Heavy Weight Lock is over, so following that way
> >> sounds more appropriate, is there any reason why you want it differently
> >> than what we are doing currently?
>
> > But we don't do the same for query, so I don't think that says much. I
> > think it'd be useful because it gives you a bit more chance to see what
> > you blocked on last, even if the time the backend was blocked was very
> > short.
>
> The problem with the query analogy is that it's possible to tell whether
> the query is active or not, by looking at the status column. We need to
> avoid a situation where you can't tell if the wait status is current or
> merely the last thing waited for.

Well, that's what the 'waiting' column would be about in the proposal I'm
commenting about.

> At the moment I'm inclined to think we should put this on the back burner
> until we see what Ilya submits. None of the proposals for changing
> pg_stat_activity sound terribly clean to me.

We'll see. To me that's two different things. Knowing what a backend is
currently blocked on is a somewhat different use case from keeping
longer running stats. E.g. debugging why vacuum is not progressing
(waiting for a cleanup lock on a page that needs to be frozen) is just
about impossible right now.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2015-06-25 14:42:54 Re: [COMMITTERS] pgsql: psql: show proper row count in \x mode for zero-column output
Previous Message Tom Lane 2015-06-25 14:01:39 Re: RFC: replace pg_stat_activity.waiting with something more descriptive