Skip site navigation (1) Skip section navigation (2)

Re: query optimization question

From: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jack Coates <jack(at)lyris(dot)com>,pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: query optimization question
Date: 2004-01-30 07:19:43
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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

In response to


pgsql-performance by date

Next:From: Dennis BjorklundDate: 2004-01-30 07:23:14
Subject: Re: query optimization question
Previous:From: Shridhar DaithankarDate: 2004-01-30 07:03:45
Subject: Re: On the performance of views

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group