Re: Strict min and max aggregate functions - Mailing list pgsql-general

From Tom Lane
Subject Re: Strict min and max aggregate functions
Date
Msg-id 10750.1479670661@sss.pgh.pa.us
Whole thread Raw
In response to Re: Strict min and max aggregate functions  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-general
Jeff Janes <jeff.janes@gmail.com> writes:
> On Sun, Nov 20, 2016 at 2:45 AM, Pavel Stehule <pavel.stehule@gmail.com>
> wrote:
>> you can use composite type instead array too.

> I tried a composite type of (flag int, value anyelement) but you can't use
> anyelement in a composite type.  So the aggregate function couldn't be
> polymorphic.  Or, that was my conclusion after making a few attempts. Maybe
> I need to give on polymorphism if I want to get performance?

I would bet on a composite type being as slow or slower than the array
solution.  You could do a quick test with a non-polymorphic definition
just to see, but I doubt it's a promising avenue.

            regards, tom lane


pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Strict min and max aggregate functions
Next
From: Michael Paquier
Date:
Subject: Re: Feature request: separate logging