From: Noah Misch <noah@leadboat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David Rowley <david.rowley@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype
Date: Sun, 26 Jun 2016 22:01:58 -0400
Message-ID: <20160627020158.GA1319154@tornado.leadboat.com> (raw)
In-Reply-To: <18443.1466693846@sss.pgh.pa.us>
References: <14538.1466116810@sss.pgh.pa.us>
<CA+TgmoaAjwaCRBe8w2UbpZD45uQ+TYwbLW7Dzf-e=VAq4m8q2w@mail.gmail.com>
<22037.1466129876@sss.pgh.pa.us>
<27247.1466185504@sss.pgh.pa.us>
<CAKJS1f8cVf6ZuKdsJ=MLC-XiagEjXmOksfNOhuwYa8pBiNBOKA@mail.gmail.com>
<CAKJS1f-Eg1Kk69gdnkUGdSEE_25DcyRXUdTNNdyHqxPWp00rSw@mail.gmail.com>
<CAKJS1f81JMq-EVygn_oyBsehsbqxE5=Xve-PEhRD_WuOeYkJrA@mail.gmail.com>
<10050.1466637736@sss.pgh.pa.us>
<CAKJS1f8Ng-ahUJKCp_7epoNh0QwBEM4YdT3ggLyXL3OdVth8xQ@mail.gmail.com>
<18443.1466693846@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On Thu, Jun 23, 2016 at 10:57:26AM -0400, Tom Lane wrote:
> David Rowley <david.rowley@2ndquadrant.com> writes:
> > On 23 June 2016 at 11:22, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >> The behavior that I'd expect (and that I documented) for a deserialization
> >> function is that it just allocates its result in the current, short-lived
> >> memory context, since it will be the combine function's responsibility to
> >> merge that into the long-lived transition state. But it looks to me like
> >> the deserialization functions in numeric.c are allocating their results
> >> in the aggregate context, which will mean a leak. (For example,
> >> numeric_avg_deserialize creates its result using makeNumericAggState
> >> which forces the result into the agg context.)
>
> > Yes, you're right.
>
> > In the end I decided to add a makeNumericAggStateCurrentContext()
> > function which does not perform any memory context switching at all.
> > It seems like this can be used for the combine functions too, since
> > they've already switched to the aggregate memory context. This should
> > save a few cycles during aggregate combine, and not expend any extra
> > as some alternatives, like adding a flag to makeNumericAggState().
>
> You missed the ones using makePolyNumAggState --- I fixed that and
> pushed it.
What, if anything, is yet required to close this 9.6 open item?
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: noah@leadboat.com, tgl@sss.pgh.pa.us, david.rowley@2ndquadrant.com, robertmhaas@gmail.com
Subject: Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype
In-Reply-To: <20160627020158.GA1319154@tornado.leadboat.com>
References: <14538.1466116810@sss.pgh.pa.us> <CA+TgmoaAjwaCRBe8w2UbpZD45uQ+TYwbLW7Dzf-e=VAq4m8q2w@mail.gmail.com> <22037.1466129876@sss.pgh.pa.us> <27247.1466185504@sss.pgh.pa.us> <CAKJS1f8cVf6ZuKdsJ=MLC-XiagEjXmOksfNOhuwYa8pBiNBOKA@mail.gmail.com> <CAKJS1f-Eg1Kk69gdnkUGdSEE_25DcyRXUdTNNdyHqxPWp00rSw@mail.gmail.com> <CAKJS1f81JMq-EVygn_oyBsehsbqxE5=Xve-PEhRD_WuOeYkJrA@mail.gmail.com> <10050.1466637736@sss.pgh.pa.us> <CAKJS1f8Ng-ahUJKCp_7epoNh0QwBEM4YdT3ggLyXL3OdVth8xQ@mail.gmail.com> <18443.1466693846@sss.pgh.pa.us> <20160627020158.GA1319154@tornado.leadboat.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox