On 2015-06-25 10:01:39 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.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