Re: slow plan for min/max - Mailing list pgsql-performance

From Tom Lane
Subject Re: slow plan for min/max
Date
Msg-id 9768.1063064551@sss.pgh.pa.us
Whole thread Raw
In response to Re: slow plan for min/max  ("Matt Clark" <matt@ymogen.net>)
Responses Re: slow plan for min/max
List pgsql-performance
"Matt Clark" <matt@ymogen.net> writes:
> Actually, referring down to later parts of this thread, why can't this
> optimisation be performed internally for built-in types?  I understand the
> issue with aggregates over user-defined types, but surely optimising max()
> for int4, text, etc is safe and easy?

I can't see that the datatype involved has anything to do with it.
None of the issues that come up in making the planner do this are
datatype-specific.  You could possibly avoid adding some columns
to pg_aggregate if you instead hard-wired the equivalent knowledge
(for builtin types only) into some code somewhere, but a patch that
approached it that way would be rejected as unmaintainable.

            regards, tom lane

pgsql-performance by date:

Previous
From: "Matt Clark"
Date:
Subject: Re: slow plan for min/max
Next
From: Odiel León
Date:
Subject: