Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-08-25 Thread Amit Kapila
On Fri, Aug 26, 2016 at 4:59 AM, neha khatri wrote: > Hello, > > I noticed that a small optimization is possible in the flow of wait stat > reporting for the LWLocks, when the pgstat_track_activities is disabled. > If the check for pgstat_track_activities is done before

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-08-25 Thread neha khatri
Hello, I noticed that a small optimization is possible in the flow of wait stat reporting for the LWLocks, when the pgstat_track_activities is disabled. If the check for pgstat_track_activities is done before invoking LWLockReportWaitStart() instead of inside the pgstat_report_wait_start(), it

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-24 Thread Robert Haas
On Thu, Mar 24, 2016 at 7:28 AM, Alexander Korotkov wrote: > Since, patch for exposing current wait event information in PGPROC was > committed, it becomes possible to collect wait event statistics using > sampling. Despite I'm not fan of this approach, it is still

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-24 Thread Alexander Korotkov
Hi! Since, patch for exposing current wait event information in PGPROC was committed, it becomes possible to collect wait event statistics using sampling. Despite I'm not fan of this approach, it is still useful and definitely better than nothing. In PostgresPro, we actually already had it.

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-19 Thread Andres Freund
On 2016-03-18 11:01:04 -0400, Robert Haas wrote: > On Thu, Mar 17, 2016 at 9:22 PM, Michael Paquier > wrote: > > FWIW, my instinctive thought on the matter is to report the event > > directly in WaitLatch() via a name of the event caller provided > > directly in it. The

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-19 Thread Robert Haas
On Wed, Mar 16, 2016 at 10:03 PM, Michael Paquier wrote: > On Wed, Mar 16, 2016 at 5:28 AM, Robert Haas wrote: >> On Tue, Mar 15, 2016 at 9:17 AM, Thomas Reiss >> wrote: >>> Here's a small docpatch to fix two typos in

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-19 Thread Michael Paquier
On Wed, Mar 16, 2016 at 5:28 AM, Robert Haas wrote: > On Tue, Mar 15, 2016 at 9:17 AM, Thomas Reiss wrote: >> Here's a small docpatch to fix two typos in the new documentation. > > Thanks, committed. I just had a quick look at the wait_event

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-19 Thread Amit Kapila
On Thu, Mar 17, 2016 at 7:33 AM, Michael Paquier wrote: > > On Wed, Mar 16, 2016 at 5:28 AM, Robert Haas wrote: > > On Tue, Mar 15, 2016 at 9:17 AM, Thomas Reiss wrote: > >> Here's a small docpatch to fix two typos in

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-19 Thread Michael Paquier
On Thu, Mar 17, 2016 at 11:10 PM, Robert Haas wrote: > On Wed, Mar 16, 2016 at 10:03 PM, Michael Paquier > wrote: >> On Wed, Mar 16, 2016 at 5:28 AM, Robert Haas wrote: >>> On Tue, Mar 15, 2016 at 9:17 AM, Thomas Reiss

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-18 Thread Robert Haas
On Thu, Mar 17, 2016 at 9:22 PM, Michael Paquier wrote: > FWIW, my instinctive thought on the matter is to report the event > directly in WaitLatch() via a name of the event caller provided > directly in it. The category of the event is then defined > automatically as

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-15 Thread Alvaro Herrera
Robert Haas wrote: > On Tue, Mar 15, 2016 at 10:41 AM, Thom Brown wrote: > >> It turns out that I hate the fact that the Wait Event Name column is > >> effectively in a random order. If a user sees a message, and goes to > >> look up the value in the wait_event description table,

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-15 Thread Robert Haas
On Tue, Mar 15, 2016 at 10:41 AM, Thom Brown wrote: >> It turns out that I hate the fact that the Wait Event Name column is >> effectively in a random order. If a user sees a message, and goes to >> look up the value in the wait_event description table, they either >> have to

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-15 Thread Robert Haas
On Tue, Mar 15, 2016 at 9:17 AM, Thomas Reiss wrote: > Here's a small docpatch to fix two typos in the new documentation. Thanks, committed. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-15 Thread Thom Brown
On 15 March 2016 at 14:00, Thom Brown wrote: > On 10 March 2016 at 18:58, Robert Haas wrote: >> On Thu, Mar 10, 2016 at 12:18 AM, Amit Kapila >> wrote: >>> On Wed, Mar 9, 2016 at 7:17 PM, Robert Haas wrote:

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-15 Thread Thom Brown
On 10 March 2016 at 18:58, Robert Haas wrote: > On Thu, Mar 10, 2016 at 12:18 AM, Amit Kapila wrote: >> On Wed, Mar 9, 2016 at 7:17 PM, Robert Haas wrote: >>> >>> On Wed, Mar 9, 2016 at 8:31 AM, Amit Kapila

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-15 Thread Thomas Reiss
Hello, Here's a small docpatch to fix two typos in the new documentation. Regards, Thomas Le 11/03/2016 07:19, Amit Kapila a écrit : On Fri, Mar 11, 2016 at 12:28 AM, Robert Haas > wrote: > > > Committed with some further editing. In

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-11 Thread Robert Haas
On Fri, Mar 11, 2016 at 1:19 AM, Amit Kapila wrote: > On Fri, Mar 11, 2016 at 12:28 AM, Robert Haas wrote: >> Committed with some further editing. In particular, the way you >> determined whether we could safely access the tranche information for

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-10 Thread Amit Kapila
On Fri, Mar 11, 2016 at 12:28 AM, Robert Haas wrote: > > > Committed with some further editing. In particular, the way you > determined whether we could safely access the tranche information for > any given ID was wrong; please check over what I did and make sure > that

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-10 Thread Robert Haas
On Thu, Mar 10, 2016 at 12:18 AM, Amit Kapila wrote: > On Wed, Mar 9, 2016 at 7:17 PM, Robert Haas wrote: >> >> On Wed, Mar 9, 2016 at 8:31 AM, Amit Kapila >> wrote: >> > Thanks for the suggestion. I have updated the

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-09 Thread Amit Kapila
On Wed, Mar 9, 2016 at 7:17 PM, Robert Haas wrote: > > On Wed, Mar 9, 2016 at 8:31 AM, Amit Kapila wrote: > > Thanks for the suggestion. I have updated the patch to include wait_event_type information in the wait_event table. > > I think we should

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-09 Thread Thom Brown
On 9 March 2016 at 13:31, Amit Kapila wrote: > On Fri, Mar 4, 2016 at 7:11 PM, Alexander Korotkov > wrote: > > > >> > >> If yes, then the only slight worry is that there will lot of repetition > in wait_event_type column, otherwise it is okay. > >

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-09 Thread Robert Haas
On Wed, Mar 9, 2016 at 8:31 AM, Amit Kapila wrote: > Thanks for the suggestion. I have updated the patch to include > wait_event_type information in the wait_event table. I think we should remove "a server process is" from all of these entries. Also, I think this kind

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-09 Thread Amit Kapila
On Fri, Mar 4, 2016 at 7:11 PM, Alexander Korotkov wrote: > >> >> If yes, then the only slight worry is that there will lot of repetition in wait_event_type column, otherwise it is okay. > > > There is morerows attribute of entry tag in Docbook SGML, it behaves like rowspan

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-04 Thread Amit Kapila
On Fri, Mar 4, 2016 at 7:23 PM, Thom Brown wrote: > > On 4 March 2016 at 13:41, Alexander Korotkov wrote: > > > >> > >> If yes, then the only slight worry is that there will lot of repetition in > >> wait_event_type column, otherwise it is okay. > > > > > >

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-04 Thread Thom Brown
On 4 March 2016 at 13:41, Alexander Korotkov wrote: > On Fri, Mar 4, 2016 at 4:20 PM, Amit Kapila wrote: >> >> On Fri, Mar 4, 2016 at 4:01 PM, Alexander Korotkov >> wrote: >>> >>> On Fri, Mar 4, 2016 at 7:05 AM, Amit Kapila

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-04 Thread Thom Brown
On 4 March 2016 at 13:35, Thom Brown wrote: > On 4 March 2016 at 04:05, Amit Kapila wrote: >> On Wed, Feb 24, 2016 at 7:14 PM, Robert Haas wrote: >>> >>> On Mon, Feb 22, 2016 at 10:05 AM, Amit Kapila >>>

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-04 Thread Alexander Korotkov
On Fri, Mar 4, 2016 at 4:20 PM, Amit Kapila wrote: > On Fri, Mar 4, 2016 at 4:01 PM, Alexander Korotkov > wrote: > >> On Fri, Mar 4, 2016 at 7:05 AM, Amit Kapila >> wrote: >> >>> > I think the wait event types should be

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-04 Thread Thom Brown
On 4 March 2016 at 04:05, Amit Kapila wrote: > On Wed, Feb 24, 2016 at 7:14 PM, Robert Haas wrote: >> >> On Mon, Feb 22, 2016 at 10:05 AM, Amit Kapila >> wrote: >> >> I wouldn't bother tinkering with it at this point. The

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-04 Thread Amit Kapila
On Fri, Mar 4, 2016 at 4:01 PM, Alexander Korotkov wrote: > On Fri, Mar 4, 2016 at 7:05 AM, Amit Kapila > wrote: > >> > I think the wait event types should be documented - and the wait >> > events too, perhaps. >> > >> >> As discussed upthread, I

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-04 Thread Alexander Korotkov
On Fri, Mar 4, 2016 at 7:05 AM, Amit Kapila wrote: > > I think the wait event types should be documented - and the wait > > events too, perhaps. > > > > As discussed upthread, I have added documentation for all the possible > wait events and an example. Some of the

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-03 Thread Amit Kapila
On Wed, Feb 24, 2016 at 7:14 PM, Robert Haas wrote: > > On Mon, Feb 22, 2016 at 10:05 AM, Amit Kapila wrote: > >> I wouldn't bother tinkering with it at this point. The value isn't > >> going to be recorded on disk anywhere, so it will be easy to

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-03-01 Thread Robert Haas
On Mon, Feb 29, 2016 at 8:01 AM, Amit Kapila wrote: > On Thu, Feb 25, 2016 at 2:54 AM, Peter Eisentraut wrote: >> >> Could you enhance the documentation about the difference between "wait >> event type name" and "wait event name" (examples?)? >> > > I am

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-02-29 Thread Amit Kapila
On Thu, Feb 25, 2016 at 2:54 AM, Peter Eisentraut wrote: > > Could you enhance the documentation about the difference between "wait > event type name" and "wait event name" (examples?)? > I am planning to add possible values for each of the wait event type and wait event and

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-02-29 Thread Amit Kapila
On Wed, Feb 24, 2016 at 7:14 PM, Robert Haas wrote: > > On Mon, Feb 22, 2016 at 10:05 AM, Amit Kapila wrote: > >> I wouldn't bother tinkering with it at this point. The value isn't > >> going to be recorded on disk anywhere, so it will be easy to

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-02-24 Thread Robert Haas
On Thu, Feb 25, 2016 at 10:31 AM, Amit Kapila wrote: >> There's no requirement that every session have every tranche >> registered. I think we should consider displaying "extension" for any >> tranche that's not built-in, or at least for tranches that are not >>

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-02-24 Thread Amit Kapila
On Wed, Feb 24, 2016 at 7:14 PM, Robert Haas wrote: > On Mon, Feb 22, 2016 at 10:05 AM, Amit Kapila > wrote: > >> I wouldn't bother tinkering with it at this point. The value isn't > >> going to be recorded on disk anywhere, so it will be easy to

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-02-24 Thread Peter Eisentraut
Could you enhance the documentation about the difference between "wait event type name" and "wait event name" (examples?)? This is likely to be quite confusing for users who are used to just the plain "waiting" column. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-02-24 Thread Robert Haas
On Mon, Feb 22, 2016 at 10:05 AM, Amit Kapila wrote: >> I wouldn't bother tinkering with it at this point. The value isn't >> going to be recorded on disk anywhere, so it will be easy to change >> the way it's computed in the future if we ever need to do that. >> > >

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-02-21 Thread Amit Kapila
On Wed, Feb 3, 2016 at 8:59 AM, Robert Haas wrote: > > On Tue, Feb 2, 2016 at 10:27 PM, Amit Kapila wrote: > > So, let's leave adding any additional column, but Alexander has brought up > > a good point about storing the wait_type and actual

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-02-02 Thread Robert Haas
On Mon, Feb 1, 2016 at 8:40 AM, Alexander Korotkov wrote: > I wonder if we can use 4-byte wait_event_info more efficiently. > LWLock number in the tranche would be also useful information to expose. > Using lwlock number user can determine if there is high concurrency for >

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-02-02 Thread Amit Kapila
On Tue, Feb 2, 2016 at 10:09 PM, Robert Haas wrote: > > On Mon, Feb 1, 2016 at 8:40 AM, Alexander Korotkov wrote: > > I wonder if we can use 4-byte wait_event_info more efficiently. > > LWLock number in the tranche would be also useful information to

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-02-02 Thread Robert Haas
On Tue, Feb 2, 2016 at 10:27 PM, Amit Kapila wrote: > So, let's leave adding any additional column, but Alexander has brought up > a good point about storing the wait_type and actual wait_event > information into four bytes. Currently I have stored wait_type (aka >

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-02-02 Thread Amit Kapila
On Mon, Feb 1, 2016 at 7:10 PM, Alexander Korotkov wrote: > On Sun, Jan 31, 2016 at 6:55 AM, Amit Kapila > wrote: > >> On Thu, Jan 28, 2016 at 9:16 AM, Amit Kapila >> wrote: >> > >> > On Thu, Jan 28, 2016 at 2:12 AM,

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-02-01 Thread Alexander Korotkov
On Sun, Jan 31, 2016 at 6:55 AM, Amit Kapila wrote: > On Thu, Jan 28, 2016 at 9:16 AM, Amit Kapila > wrote: > > > > On Thu, Jan 28, 2016 at 2:12 AM, Robert Haas > wrote: > > > > > > On Tue, Jan 26, 2016 at 3:10 AM,

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-01-30 Thread Amit Kapila
On Thu, Jan 28, 2016 at 9:16 AM, Amit Kapila wrote: > > On Thu, Jan 28, 2016 at 2:12 AM, Robert Haas wrote: > > > > On Tue, Jan 26, 2016 at 3:10 AM, and...@anarazel.de wrote: > > > I do think there's a considerable benefit in

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-01-27 Thread Amit Kapila
On Thu, Jan 28, 2016 at 2:12 AM, Robert Haas wrote: > > On Tue, Jan 26, 2016 at 3:10 AM, and...@anarazel.de wrote: > > I do think there's a considerable benefit in improving the > > instrumentation here, but his strikes me as making live more complex

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-01-27 Thread Robert Haas
On Tue, Jan 26, 2016 at 3:10 AM, and...@anarazel.de wrote: > I do think there's a considerable benefit in improving the > instrumentation here, but his strikes me as making live more complex for > more users than it makes it easier. At the very least this should be > split

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-01-26 Thread Amit Kapila
On Tue, Jan 26, 2016 at 1:40 PM, and...@anarazel.de wrote: > > On 2016-01-26 13:22:09 +0530, Amit Kapila wrote: > > @@ -633,9 +633,11 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser > > Time when the state was last changed > > > >

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-01-26 Thread and...@anarazel.de
On 2016-01-26 13:22:09 +0530, Amit Kapila wrote: > @@ -633,9 +633,11 @@ postgres 27093 0.0 0.0 30096 2752 ?Ss > 11:34 0:00 postgres: ser > Time when the state was last changed > > > - waiting > - boolean > - True if this backend is currently waiting

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-01-25 Thread Amit Kapila
On Wed, Jan 20, 2016 at 6:39 PM, Robert Haas wrote: > > On Tue, Jan 19, 2016 at 11:49 PM, Amit Kapila wrote: > >> On the topic of the UI, I understand that redefining > >> pg_stat_activity.waiting might cause some short-term annoyance. But I > >>

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-01-20 Thread Robert Haas
On Tue, Jan 19, 2016 at 11:49 PM, Amit Kapila wrote: >> My opinion is that storing the information in PGPROC is better because >> it seems like we can fairly painlessly expose 4 bytes of data that way >> instead of 1, which is nice. > > Okay, do you mean to say that we

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-01-19 Thread Robert Haas
On Mon, Jan 18, 2016 at 10:41 PM, Amit Kapila wrote: > Initially, we started with extending the 'waiting' column in > pg_stat_activity, > to which some people have raised concerns about backward > compatability, so another option that came-up during discussion was to >

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-01-19 Thread Amit Kapila
On Wed, Jan 20, 2016 at 12:41 AM, Robert Haas wrote: > > On Mon, Jan 18, 2016 at 10:41 PM, Amit Kapila wrote: > > Second important and somewhat related point is whether we should save > > this information in PGPROC as 4 bytes or keep it in

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-01-18 Thread Robert Haas
On Mon, Jan 18, 2016 at 11:09 AM, Alvaro Herrera wrote: > Amit Kapila wrote: > >> The reason for not updating the patch related to this thread is that it is >> dependent on the work for refactoring the tranches for LWLocks [1] >> which is now coming towards an end, so I

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-01-18 Thread Alvaro Herrera
Amit Kapila wrote: > The reason for not updating the patch related to this thread is that it is > dependent on the work for refactoring the tranches for LWLocks [1] > which is now coming towards an end, so I think it is quite reasonable > that the patch can be updated for this work during commit

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2016-01-18 Thread Amit Kapila
On Mon, Jan 18, 2016 at 11:06 PM, Robert Haas wrote: > > On Mon, Jan 18, 2016 at 11:09 AM, Alvaro Herrera > wrote: > > Amit Kapila wrote: > > > >> The reason for not updating the patch related to this thread is that it is > >> dependent on the

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-12-31 Thread Amit Kapila
On Thu, Dec 24, 2015 at 8:02 AM, Michael Paquier wrote: > > On Tue, Nov 17, 2015 at 8:36 PM, Vladimir Borodin wrote: > > > > 14 нояб. 2015 г., в 10:50, Amit Kapila написал(а): > > > > On Wed, Sep 16, 2015 at 11:22 PM, Robert

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-12-23 Thread Michael Paquier
On Tue, Nov 17, 2015 at 8:36 PM, Vladimir Borodin wrote: > > 14 нояб. 2015 г., в 10:50, Amit Kapila написал(а): > > On Wed, Sep 16, 2015 at 11:22 PM, Robert Haas wrote: >> On Wed, Sep 16, 2015 at 12:29 PM, Alexander Korotkov >>

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-11-17 Thread Vladimir Borodin
> 14 нояб. 2015 г., в 10:50, Amit Kapila написал(а): > > On Wed, Sep 16, 2015 at 11:22 PM, Robert Haas > wrote: > > On Wed, Sep 16, 2015 at 12:29 PM, Alexander Korotkov > >

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-11-14 Thread Craig Ringer
On 14 November 2015 at 15:50, Amit Kapila wrote: > One thing that occurred to me in this context is that if we store the wait > event information in PGPROC, then can we think of providing the info > about wait events in a separate view pg_stat_waits (or

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-11-13 Thread Amit Kapila
On Wed, Sep 16, 2015 at 11:22 PM, Robert Haas wrote: > On Wed, Sep 16, 2015 at 12:29 PM, Alexander Korotkov > wrote: > > >> I think it's reasonable to consider reporting this data in the PGPROC > >> using a 4-byte integer rather than reporting it

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-20 Thread Robert Haas
On Fri, Sep 18, 2015 at 4:43 PM, Vladimir Borodin wrote: > No, probably you misunderstood the results, let me explain one more time. Yeah, I did, sorry. > Unpatched PostgreSQL from REL9_4_STABLE gave 15500 tps. Version with timings > - 14500 tps which is 6,5% worse. Version

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-18 Thread Vladimir Borodin
> 18 сент. 2015 г., в 20:16, Robert Haas написал(а): > > On Fri, Sep 18, 2015 at 4:08 AM, Vladimir Borodin wrote: >> For both scenarios on linux we got approximately the same results - version >> with timings was faster then version with sampling

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-18 Thread Vladimir Borodin
> 16 сент. 2015 г., в 20:52, Robert Haas написал(а): > > On Wed, Sep 16, 2015 at 12:29 PM, Alexander Korotkov > wrote: >> Yes, the major question is cost. But I think we should validate our thoughts >> by experiments assuming there are more possible

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-18 Thread Robert Haas
On Fri, Sep 18, 2015 at 4:08 AM, Vladimir Borodin wrote: > For both scenarios on linux we got approximately the same results - version > with timings was faster then version with sampling (sampling was done every > 10 ms). Vanilla PostgreSQL from REL9_4_STABLE gave ~15500 tps

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-16 Thread Alexander Korotkov
On Mon, Sep 14, 2015 at 3:03 PM, Robert Haas wrote: > On Mon, Sep 14, 2015 at 5:32 AM, Alexander Korotkov > wrote: > > In order to build the consensus we need the roadmap for waits monitoring. > > Would single byte in PgBackendStatus be the only way

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-16 Thread Robert Haas
On Wed, Sep 16, 2015 at 12:29 PM, Alexander Korotkov wrote: > Yes, the major question is cost. But I think we should validate our thoughts > by experiments assuming there are more possible synchronization protocols. > Ildus posted implemention of double buffering approach

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-14 Thread Amit Kapila
On Mon, Sep 14, 2015 at 3:02 PM, Alexander Korotkov wrote: > On Sat, Sep 12, 2015 at 3:24 PM, Amit Kapila > wrote: > >> On Fri, Aug 14, 2015 at 7:23 PM, Alexander Korotkov >> wrote: >> > >> > On Thu, Aug 6, 2015 at 1:01 PM,

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-14 Thread Robert Haas
On Mon, Sep 14, 2015 at 5:32 AM, Alexander Korotkov wrote: > In order to build the consensus we need the roadmap for waits monitoring. > Would single byte in PgBackendStatus be the only way for tracking wait > events? Could we have pluggable infrastructure in waits

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-14 Thread Amit Kapila
On Sun, Sep 13, 2015 at 8:06 AM, Robert Haas wrote: > > On Sat, Sep 12, 2015 at 8:24 AM, Amit Kapila wrote: > > 1. Modify the tranche mechanism so that information about LWLocks > > can be tracked easily. For this already there is some discussion,

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-14 Thread Alexander Korotkov
On Mon, Sep 14, 2015 at 2:12 PM, Amit Kapila wrote: > On Mon, Sep 14, 2015 at 2:25 PM, Alexander Korotkov > wrote: > >> On Sat, Sep 12, 2015 at 2:05 PM, Amit Kapila >> wrote: >> >>> On Thu, Aug 6, 2015 at 3:31 PM, Ildus

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-14 Thread Alexander Korotkov
On Mon, Sep 14, 2015 at 2:25 PM, Amit Kapila wrote: > On Mon, Sep 14, 2015 at 3:02 PM, Alexander Korotkov > wrote: > >> On Sat, Sep 12, 2015 at 3:24 PM, Amit Kapila >> wrote: >> >>> On Fri, Aug 14, 2015 at 7:23 PM,

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-14 Thread Amit Kapila
On Mon, Sep 14, 2015 at 2:25 PM, Alexander Korotkov wrote: > On Sat, Sep 12, 2015 at 2:05 PM, Amit Kapila > wrote: > >> On Thu, Aug 6, 2015 at 3:31 PM, Ildus Kurbangaliev < >> i.kurbangal...@postgrespro.ru> wrote: >> > >> > On 08/05/2015 09:33 PM,

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-14 Thread Vladimir Borodin
> 12 сент. 2015 г., в 14:05, Amit Kapila написал(а): > > On Thu, Aug 6, 2015 at 3:31 PM, Ildus Kurbangaliev > > wrote: > > > > On 08/05/2015 09:33 PM, Robert Haas wrote: > >> > >> > >> You're missing

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-14 Thread Alexander Korotkov
On Sat, Sep 12, 2015 at 2:05 PM, Amit Kapila wrote: > On Thu, Aug 6, 2015 at 3:31 PM, Ildus Kurbangaliev < > i.kurbangal...@postgrespro.ru> wrote: > > > > On 08/05/2015 09:33 PM, Robert Haas wrote: > >> > >> > >> You're missing the point. Those multi-byte fields have

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-14 Thread Alexander Korotkov
On Sat, Sep 12, 2015 at 3:24 PM, Amit Kapila wrote: > On Fri, Aug 14, 2015 at 7:23 PM, Alexander Korotkov > wrote: > > > > On Thu, Aug 6, 2015 at 1:01 PM, Ildus Kurbangaliev < > i.kurbangal...@postgrespro.ru> wrote: > >> > >> > >> I've looked

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-13 Thread Ildus Kurbangaliev
> On Sep 13, 2015, at 5:36 AM, Robert Haas wrote: > > On Sat, Sep 12, 2015 at 8:24 AM, Amit Kapila wrote: >> 1. Modify the tranche mechanism so that information about LWLocks >> can be tracked easily. For this already there is some discussion,

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-13 Thread Robert Haas
On Sun, Sep 13, 2015 at 11:09 AM, Ildus Kurbangaliev wrote: > This is pretty much the same that my patch does. There is > two API calls (for a size determination and a tranche creation), except > MainLWLockArray is used only for individual LWLocks. It's not really

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-12 Thread Robert Haas
On Sat, Sep 12, 2015 at 8:24 AM, Amit Kapila wrote: > 1. Modify the tranche mechanism so that information about LWLocks > can be tracked easily. For this already there is some discussion, ideas > and initial patch is floated in this thread and there doesn't seem to be >

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-12 Thread Amit Kapila
On Thu, Aug 6, 2015 at 3:31 PM, Ildus Kurbangaliev < i.kurbangal...@postgrespro.ru> wrote: > > On 08/05/2015 09:33 PM, Robert Haas wrote: >> >> >> You're missing the point. Those multi-byte fields have additional >> synchronization requirements, as I explained in some detail in my >> previous

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-12 Thread Amit Kapila
On Fri, Aug 14, 2015 at 7:23 PM, Alexander Korotkov wrote: > > On Thu, Aug 6, 2015 at 1:01 PM, Ildus Kurbangaliev < i.kurbangal...@postgrespro.ru> wrote: >> >> >> I've looked deeper and I found PgBackendStatus to be not a suitable >> place for keeping information about low

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-02 Thread Robert Haas
On Tue, Sep 1, 2015 at 6:43 PM, and...@anarazel.de wrote: > Why a new tranche for each of these? And it can't be correct that each > has the same base? I complained about the same-base problem before. Apparently, that got ignored. > I don't really like the tranche model as

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-09-01 Thread and...@anarazel.de
On 2015-08-04 23:37:08 +0300, Ildus Kurbangaliev wrote: > diff --git a/src/backend/access/transam/clog.c > b/src/backend/access/transam/clog.c > index 3a58f1e..10c25cf 100644 > --- a/src/backend/access/transam/clog.c > +++ b/src/backend/access/transam/clog.c > @@ -457,7 +457,8 @@

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-26 Thread Bruce Momjian
On Mon, Jul 27, 2015 at 04:10:14PM -0500, Jim Nasby wrote: Sure, but I don't think this makes it impossible to figure out who's locking who. I think the only thing you need other than the data in pg_locks is the conflicts table, which is well documented. Oh, hmm, one thing missing is the

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-14 Thread Tom Lane
Alexander Korotkov aekorot...@gmail.com writes: On Thu, Aug 6, 2015 at 1:01 PM, Ildus Kurbangaliev i.kurbangal...@postgrespro.ru wrote: This is why I think we shoudn't place wait event into PgBackendStatus. It could be placed into PGPROC or even separate data structure with different

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-14 Thread Alexander Korotkov
On Thu, Aug 6, 2015 at 1:01 PM, Ildus Kurbangaliev i.kurbangal...@postgrespro.ru wrote: On 08/05/2015 09:33 PM, Robert Haas wrote: On Wed, Aug 5, 2015 at 1:10 PM, Ildus Kurbangaliev i.kurbangal...@postgrespro.ru wrote: About `memcpy`, PgBackendStatus struct already have a bunch of

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-06 Thread Ildus Kurbangaliev
On 08/05/2015 09:33 PM, Robert Haas wrote: On Wed, Aug 5, 2015 at 1:10 PM, Ildus Kurbangaliev i.kurbangal...@postgrespro.ru wrote: About `memcpy`, PgBackendStatus struct already have a bunch of multi-byte variables, so it will be not consistent anyway if somebody will want to copy it in that

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-05 Thread Amit Kapila
On Tue, Aug 4, 2015 at 5:45 PM, Robert Haas robertmh...@gmail.com wrote: On Tue, Jul 28, 2015 at 3:28 PM, Heikki Linnakangas hlinn...@iki.fi wrote: * The patch requires that the LWLOCK_INDIVIDUAL_NAMES array is kept in sync with the list of individual locks in lwlock.h. Sooner or later

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-05 Thread Robert Haas
On Tue, Aug 4, 2015 at 8:46 PM, Josh Berkus j...@agliodbs.com wrote: On 06/25/2015 07:50 AM, Tom Lane wrote: To do that, we'd have to change the semantics of the 'waiting' column so that it becomes true for non-heavyweight-lock waits. I'm not sure whether that's a good idea or not; I'm afraid

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-05 Thread Ildus Kurbangaliev
On 08/04/2015 11:47 PM, Robert Haas wrote: On Tue, Aug 4, 2015 at 4:37 PM, Ildus Kurbangaliev i.kurbangal...@postgrespro.ru wrote: A new version of the patch. I used your idea with macros, and with tranches that allowed us to remove array with names (they can be written directly to the

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-05 Thread Robert Haas
On Wed, Aug 5, 2015 at 1:10 PM, Ildus Kurbangaliev i.kurbangal...@postgrespro.ru wrote: About `memcpy`, PgBackendStatus struct already have a bunch of multi-byte variables, so it will be not consistent anyway if somebody will want to copy it in that way. On the other hand two bytes in this

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-04 Thread Ildus Kurbangaliev
On 08/03/2015 04:25 PM, Ildus Kurbangaliev wrote: On 07/28/2015 10:28 PM, Heikki Linnakangas wrote: On 07/27/2015 01:20 PM, Ildus Kurbangaliev wrote: Hello. In the attached patch I've made a refactoring for tranches. The prefix for them was extended, and I've did a split of LWLockAssign to

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-04 Thread Ildus Kurbangaliev
On 08/04/2015 03:15 PM, Robert Haas wrote: On Tue, Jul 28, 2015 at 3:28 PM, Heikki Linnakangashlinn...@iki.fi wrote: * The patch requires that the LWLOCK_INDIVIDUAL_NAMES array is kept in sync with the list of individual locks in lwlock.h. Sooner or later someone will add an LWLock and forget

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-04 Thread Heikki Linnakangas
On 08/04/2015 03:15 PM, Robert Haas wrote: On Tue, Jul 28, 2015 at 3:28 PM, Heikki Linnakangas hlinn...@iki.fi wrote: * The patch requires that the LWLOCK_INDIVIDUAL_NAMES array is kept in sync with the list of individual locks in lwlock.h. Sooner or later someone will add an LWLock and forget

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-04 Thread Robert Haas
On Tue, Jul 28, 2015 at 3:28 PM, Heikki Linnakangas hlinn...@iki.fi wrote: * The patch requires that the LWLOCK_INDIVIDUAL_NAMES array is kept in sync with the list of individual locks in lwlock.h. Sooner or later someone will add an LWLock and forget to update the names-array. That needs to be

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-04 Thread Robert Haas
On Tue, Aug 4, 2015 at 4:37 PM, Ildus Kurbangaliev i.kurbangal...@postgrespro.ru wrote: A new version of the patch. I used your idea with macros, and with tranches that allowed us to remove array with names (they can be written directly to the corresponding tranche). You seem not to have

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-04 Thread Robert Haas
On Tue, Aug 4, 2015 at 4:47 PM, Robert Haas robertmh...@gmail.com wrote: On Tue, Aug 4, 2015 at 4:37 PM, Ildus Kurbangaliev i.kurbangal...@postgrespro.ru wrote: A new version of the patch. I used your idea with macros, and with tranches that allowed us to remove array with names (they can be

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-04 Thread Alvaro Herrera
Ildus Kurbangaliev wrote: A new version of the patch. I used your idea with macros, and with tranches that allowed us to remove array with names (they can be written directly to the corresponding tranche). Just a bystander here, I haven't reviewed this patch at all, but I have two

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-04 Thread Ildus Kurbangaliev
On Aug 4, 2015, at 4:54 PM, Heikki Linnakangas hlinn...@iki.fi wrote: On 08/04/2015 03:15 PM, Robert Haas wrote: On Tue, Jul 28, 2015 at 3:28 PM, Heikki Linnakangas hlinn...@iki.fi wrote: * The patch requires that the LWLOCK_INDIVIDUAL_NAMES array is kept in sync with the list of

Re: [HACKERS] RFC: replace pg_stat_activity.waiting with something more descriptive

2015-08-03 Thread Ildus Kurbangaliev
On 07/28/2015 10:28 PM, Heikki Linnakangas wrote: On 07/27/2015 01:20 PM, Ildus Kurbangaliev wrote: Hello. In the attached patch I've made a refactoring for tranches. The prefix for them was extended, and I've did a split of LWLockAssign to two functions (one with tranche and second for user

  1   2   >