Re: pg_stat_activity.waiting_start

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Joel Jacobson <joel(at)trustly(dot)com>, Greg Stark <stark(at)mit(dot)edu>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: pg_stat_activity.waiting_start
Date: 2017-01-08 01:09:22
Message-ID: 4efc5505-554c-1fc6-6832-43924268088a@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/7/17 12:41 PM, Joel Jacobson wrote:
> On Sat, Jan 7, 2017 at 3:25 AM, Greg Stark <stark(at)mit(dot)edu> wrote:
>> What users need to know is in aggregate how much of the time the
>> database is spending working on their queries is going into different
>> states.
>
> This is a separate feature idea, but I think it's really valuable as well.
>
> Maybe something similar to pg_stat_user_functions?
> But instead grouping by wait_event_type, wait_event, and showing
> accumulated count and sum of waiting time since last stat reset, just
> like the other pg_stat_* views?
>
> Maybe something like this?
>
> \d pg_stat_waiting
> View "pg_catalog.pg_stat_waiting"
> Column | Type | Modifiers
> -----------------+------------------+-----------
> wait_event_type | name |
> wait_event | name |
> waiting_counter | bigint |
> waiting_time | double precision |

Yes, I've wanted this many times in the past. If combined with Robert's
idea of a background process that does the expensive time calls this
could potentially provide very useful information for even very short
duration locks.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2017-01-08 01:19:11 Re: Replication/backup defaults
Previous Message Jim Nasby 2017-01-08 01:04:04 Re: pg_stat_activity.waiting_start