Re: ORDER BY <field not in return list>

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, "Jeffrey W(dot) Baker" <jwbaker(at)acm(dot)org>
Subject: Re: ORDER BY <field not in return list>
Date: 2005-07-28 00:26:26
Message-ID: 200507271726.26317.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Marc,

> Basically, from how everyone has explained it, the ORDER BY will be done
> after all the JOINs are done, and the "product of the joins" are
> complete ... for it to be performed on a field not in the SELECT <field>
> clause, then those fields have to be "loaded into memory", *then*
> ORDERed, and then the query would return teh result set out of those
> "mega table" ...

Pretty much, yes. We have to load the referenced rows anyway because
that's the only way to locate visibility information, which is critical
for an inner join.

However, this discussion doesn't really belong on -hackers. Why don't you
bring it over to IRC?

--
--Josh

Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-07-28 00:32:00 Re: Some new list.c primitives
Previous Message David Fetter 2005-07-28 00:25:32 Re: Some new list.c primitives