Re: optimizer not eliminating redundant sorts

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: optimizer not eliminating redundant sorts
Date: 2003-02-06 23:53:08
Message-ID: 18226.1044575588@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greg Stark <gsstark(at)mit(dot)edu> writes:
> Another odd thing. This type of query seems to be causing redundant sorts.
> From what I've read in the source it tries quite hard to keep track of the
> sort order of subplans to avoid unnecessary sorts, so I think these are
> supposed to get optimized out.

It doesn't keep track of sort keys across subquery boundaries, which is
what you've got here. I've thought about that in the past, but it'd be
nontrivial --- the sort keys known for the lower path would have to be
translated into the Var namespace of the upper query. Hasn't got to the
top of the todo queue.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mitch 2003-02-07 00:45:06 Re: FreeBSD: SMP and PostgreSQL
Previous Message Bruno Wolff III 2003-02-06 23:33:14 Re: Pg_dumpall problem[2]