Re: [HACKERS] Re: [GENERAL] Re: [PHP3] Re: PostgreSQL vs Mysql comparison

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: luuk(at)wxs(dot)nl, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Re: [GENERAL] Re: [PHP3] Re: PostgreSQL vs Mysql comparison
Date: 1999-10-05 22:34:07
Message-ID: 199910052234.SAA29584@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> writes:
> > But can we compare aggs and non-aggs? I see now that our code is fine:
>
> No, you're barking up the wrong tree. The issue is whether a HAVING
> clause that doesn't contain *any* aggregates is legal/reasonable.
> It can contain non-aggregated references to GROUP BY columns in
> any case. But without aggregates, there's no semantic difference
> from putting the same condition in WHERE.
>
> I believe that planner.c currently has an implementation assumption
> that HAVING must have an aggregate (because it hangs the HAVING clause
> onto the Agg plan node as a qual clause --- if no Agg node, no place to
> perform the HAVING test). This could be fixed if we felt it was worth
> doing.
>
> I can't get excited about changing this from the standpoint of
> functionality, because AFAICS there is no added functionality.
> But if we're looking bad on a recognized benchmark maybe we
> should do something about it.

Agreed. I think there are too many people who get HAVING confused to
allow it. Better that we should prevent it and make them do it right.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-10-05 22:42:31 Re: [HACKERS] Database names with spaces
Previous Message Tom Lane 1999-10-05 22:29:45 Re: [HACKERS] Re: [GENERAL] Re: [PHP3] Re: PostgreSQL vs Mysql comparison