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

From Greg Stark
Subject Re: [HACKERS] pg_stat_activity.waiting_start
Date
Msg-id CAM-w4HOR4Jo6ecj12t3ae9Kj7kFg9EFAcvc3X1jNY6c0QeF+iw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] pg_stat_activity.waiting_start  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] pg_stat_activity.waiting_start
List pgsql-hackers


On Dec 24, 2016 5:44 PM, "Tom Lane" <tgl@sss.pgh.pa.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.

pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: [HACKERS] BUG: pg_stat_statements query normalization issueswith combined queries
Next
From: Fabien COELHO
Date:
Subject: Re: [HACKERS] BUG: pg_stat_statements query normalization issueswith combined queries