Re: pg_stat_activity.waiting_start

From: Greg Stark <stark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Joel Jacobson <joel(at)trustly(dot)com>
Subject: Re: pg_stat_activity.waiting_start
Date: 2016-12-27 17:17:36
Message-ID: CAM-w4HOR4Jo6ecj12t3ae9Kj7kFg9EFAcvc3X1jNY6c0QeF+iw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Dec 24, 2016 5:44 PM, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

I think we'd need at least an order of
magnitude cheaper to consider putting timing calls into spinlock or lwlock
paths, and that's just not available at all, let alone portably.

For spinlocks we could conceivably just bite the bullet and use a raw rdtsc
or the equivalent for other platforms. It might be pretty easy to
distinguish sane numbers from numbers that result after a process
reschedule and we could just discard data when that happens (or count
occurrences).

That may possibly work for spinlocks but it won't work for anything heavier
where process reschedules are routine.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2016-12-27 17:51:44 Re: BUG: pg_stat_statements query normalization issues with combined queries
Previous Message Fabien COELHO 2016-12-27 17:16:45 Re: BUG: pg_stat_statements query normalization issues with combined queries