Re: query optimization question - Mailing list pgsql-performance

From Dennis Bjorklund
Subject Re: query optimization question
Date
Msg-id Pine.LNX.4.44.0401300815390.30205-100000@zigo.dhs.org
Whole thread Raw
In response to Re: query optimization question  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: query optimization question
List pgsql-performance
On Thu, 29 Jan 2004, Tom Lane wrote:

> > jackdb-# GROUP BY memberid_ HAVING (
>
> Um, that's not what I had in mind at all.  Does GROUP BY actually do
> anything at all here?  (You didn't answer me as to whether memberid_
> is a unique identifier or not, but if it is, this GROUP BY is just an
> expensive no-op.)

From your comment I assume that there is no transformation in pg that
detects that the group by columns are unique?

> this is all blue-sky speculation anyway.  What I'm actually more
> interested in is your statement that MSSQL can do the original query
> quickly.  I find that a bit hard to believe because I don't see any
> relevant optimization techniques.

Getting rid of the group by would not give that kind of speedup? Maybe
mssql manage to rewrite the query like that before executing.

--
/Dennis Björklund


pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: query optimization differs between view and explicit
Next
From: Dennis Bjorklund
Date:
Subject: Re: query optimization question