From: Tom Lane <tgl@sss.pgh.pa.us>
To: Neil Conway <neilc@samurai.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: PostgreSQL Performance <pgsql-performance@postgresql.org>
Subject: Re: Query question
Date: Fri, 14 Nov 2003 11:40:42 -0500
Message-ID: <26648.1068828042@sss.pgh.pa.us> (raw)
In-Reply-To: <87llqjj5n0.fsf@mailbox.samurai.com>
References: <3FB303E9.20903@familyhealth.com.au>
<200311122120.28882.josh@agliodbs.com>
<87llqjj5n0.fsf@mailbox.samurai.com>
Neil Conway <neilc@samurai.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, neilc@samurai.com, josh@agliodbs.com, chriskl@familyhealth.com.au
Subject: Re: Query question
In-Reply-To: <26648.1068828042@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox