Re: MAX/MIN optimization via rewrite (plus query rewrites generally)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: MAX/MIN optimization via rewrite (plus query rewrites generally)
Date: 2004-11-11 19:26:36
Message-ID: 10557.1100201196@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark <gsstark(at)mit(dot)edu> writes:
> It would also make it possible to deprecate DISTINCT ON in favour of GROUP BY
> with first() calls.

Oh? How is a first() aggregate going to know what sort order you want
within the group? AFAICS first() is only useful when you honestly do
not care which group member you get ... which is certainly not the case
for applications of DISTINCT ON.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-11-11 19:32:04 Re: MAX/MIN optimization via rewrite (plus query rewrites generally)
Previous Message Tom Lane 2004-11-11 19:20:19 Re: multiline CSV fields