Re: Query question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, PostgreSQL Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Query question
Date: 2003-11-14 16:40:42
Message-ID: 26648.1068828042@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Neil Conway <neilc(at)samurai(dot)com> writes:
> Interesting -- I wonder if it would be possible for the optimizer to
> detect this and avoid the redundant inner sort ... (/me muses to
> himself)

I think the ability to generate two sort steps is a feature, not a bug.
This has been often requested in connection with user-defined
aggregates, where it's handy to be able to control the order of arrival
of rows at the aggregation function. If the optimizer suppressed the
inner sort then we'd lose that ability.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Hannu Krosing 2003-11-14 17:43:27 Re: Help with count(*)
Previous Message Manfred Koizar 2003-11-14 16:35:44 Re: Seeking help with a query that takes too long