From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Andres Freund <andres(at)anarazel(dot)de> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Васильев Дмитрий <d(dot)vasilyev(at)postgrespro(dot)ru>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Performance degradation in commit ac1d794 |
Date: | 2016-03-18 09:58:11 |
Message-ID: | CA+Tgmoa1dK=mUcfFYJY3gOu6932Dg0dpS=qVf4qL6VxQ=OSAuQ@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, Mar 17, 2016 at 11:17 AM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> Right now, do use a WaitEventSet you'd do something like
> WaitEvent event;
>
> ModifyWaitEvent(FeBeWaitSet, 0, waitfor, NULL);
>
> WaitEventSetWait(FeBeWaitSet, 0 /* no timeout */, &event, 1);
>
> i.e. use a WaitEvent on the stack to receive the changes. If you wanted
> to get more changes than just one, you could end up allocating a fair
> bit of stack space.
>
> We could instead allocate the returned events as part of the event set,
> and return them. Either by returning a NULL terminated array, or by
> continuing to return the number of events as now, and additionally
> return the event data structure via a pointer.
>
> So the above would be
>
> WaitEvent *events;
> int nevents;
>
> ModifyWaitEvent(FeBeWaitSet, 0, waitfor, NULL);
>
> nevents = WaitEventSetWait(FeBeWaitSet, 0 /* no timeout */, events, 10);
>
> for (int off = 0; off <= nevents; nevents++)
> ; // stuff
I don't see this as being particularly better.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | Dean Rasheed | 2016-03-18 10:20:24 | Re: improving GROUP BY estimation |
Previous Message | Robert Haas | 2016-03-18 09:56:41 | Re: Performance degradation in commit ac1d794 |