pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Matt Clark <matt@ymogen.net>
Cc: scott.marlowe <scott.marlowe@ihs.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: slow plan for min/max
Date: Mon, 08 Sep 2003 19:42:31 -0400
Message-ID: <9768.1063064551@sss.pgh.pa.us> (raw)
In-Reply-To: <LFEIJBEOKGPDHCEMDGNFEEGGCAAA.matt@ymogen.net>
References: <LFEIJBEOKGPDHCEMDGNFEEGGCAAA.matt@ymogen.net>

"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



view thread (20+ messages)  latest in thread

Message-ID: <9768.1063064551@sss.pgh.pa.us>
Permalink:  ../9768.1063064551@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9768.1063064551@sss.pgh.pa.us

 · 

reply

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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, matt@ymogen.net, scott.marlowe@ihs.com
  Subject: Re: slow plan for min/max
  In-Reply-To: <9768.1063064551@sss.pgh.pa.us>
  References: <LFEIJBEOKGPDHCEMDGNFEEGGCAAA.matt@ymogen.net> <9768.1063064551@sss.pgh.pa.us>

* 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