Re: [HACKERS] pg_stat_activity.waiting_start - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] pg_stat_activity.waiting_start
Date
Msg-id 8779.1482544859@sss.pgh.pa.us
Whole thread Raw
In response to [HACKERS] pg_stat_activity.waiting_start  (Joel Jacobson <joel@trustly.com>)
Responses Re: [HACKERS] pg_stat_activity.waiting_start  (Joel Jacobson <joel@trustly.com>)
Re: [HACKERS] pg_stat_activity.waiting_start  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Joel Jacobson <joel@trustly.com> writes:
> We already have xact_start, query_start and backend_start
> to get the timestamptz for when different things happened.

> I would like to propose adding a fourth such column, "waiting_start",
> which would tell how long time a backend has been waiting.

The difficulty with that is it'd require a gettimeofday() call for
every wait start.  Even on platforms where those are relatively cheap,
the overhead would be nasty --- and on some platforms, it'd be
astonishingly bad.  We sweated quite a lot to get the overhead of
pg_stat_activity wait monitoring down to the point where it would be
tolerable for non-heavyweight locks, but I'm afraid this would push
it back into the not-tolerable range.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Joel Jacobson
Date:
Subject: Re: [HACKERS] pg_stat_activity.waiting_start
Next
From: Stephen Frost
Date:
Subject: Re: [HACKERS] pg_stat_activity.waiting_start