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

Re: How to avoid redundant Sort operations? (pgsql 7.1.2)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Aris Tsois <atsois(at)dblab(dot)ece(dot)ntua(dot)gr>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How to avoid redundant Sort operations? (pgsql 7.1.2)
Date: 2002-01-22 16:31:12
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Aris Tsois <atsois(at)dblab(dot)ece(dot)ntua(dot)gr> writes:
> Is there any way to avoid those redundant sort operations?

Information about sort order doesn't propagate up through "subquery
scan" nodes.  There are a couple of reasons for this, one being that
pathkeys aren't returned as part of a completed Plan; there'd have to be
some uglification of the APIs of subquery_planner, grouping_planner, etc
to return the appropriate pathkeys along with the finished plan.
A more subtle problem is that pathkeys of a sub-plan aren't necessarily
meaningful for an outer plan (eg, the variables being sorted on might
not even be visible to the outer query).  I think you'd have to do some
kind of translation to see if you could restate the inner pathkeys in
terms of the subplan's output variables.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Justin CliftDate: 2002-01-22 16:33:26
Subject: Re: [HACKERS] PostgreSQL Licence: GNU/GPL
Previous:From: Thomas LockhartDate: 2002-01-22 16:25:11
Subject: Re: [HACKERS] PostgreSQL Licence: GNU/GPL

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