Re: [HACKERS] More on GROUP BY

From: jwieck(at)debis(dot)com (Jan Wieck)
To: tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane)
Cc: jwieck(at)debis(dot)com, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] More on GROUP BY
Date: 1999-05-12 10:22:03
Message-ID: m10hW9L-000EBaC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> All true, but so what? It wastes a few bytes of memory during
> planning, I suppose...

Not only memory, rewriting takes time too. If the GROUP BY
clause has view columns, the rewriter has to change all the
expressions twice, one time in the targetlist, another time
in the group clause. Wasted efford if they should still be
equal after rewriting.

> I think it's true that using a TLE for each grouplist item is a waste of
> space, and that representing the grouplist as simply a list of expr's
> would be good enough. But pulling out the TLE decoration seems like
> it's not an appropriate use of time at this stage of the release cycle.
> I'd say hold off till after 6.5, then fold it in with the parsetree
> redesign that you keep muttering we need (I agree!).

I'm sure since I began to look at it that it's not such a
good idea to make those changes at this stage. But in fact
some of them have to be done to make GROUP BY in views more
robust.

>
> BTW, you keep using the term "RTE" which I'm not familiar with ---
> I assume it's just referring to the parse tree nodes?

RTE == RangeTableEntry. The relations where the data in the
querytree is coming from. The varno in Var nodes is the index
into that table so the varno plus the varattno identify one
relations attribute.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck(at)debis(dot)com (Jan Wieck) #

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-05-12 10:26:50 Re: [HACKERS] 6.5 TODO list
Previous Message Tatsuo Ishii 1999-05-12 09:13:26 defalut value