Re: Sorting performance vs. MySQL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Yang Zhang <yanghatespam(at)gmail(dot)com>
Cc: Alex Hunsaker <badalex(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Sorting performance vs. MySQL
Date: 2010-02-23 06:03:48
Message-ID: 11997.1266905028@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yang Zhang <yanghatespam(at)gmail(dot)com> writes:
>> # select count(1) from (SELECT * from metarelcould_transactionlog
>> order by transactionid) as foo;

> Does it strike anyone else that the query optimizer/rewriter should be
> able to toss out the sort from such a query altogether?

It could, if it knew that the aggregate function didn't care about input
row order. We don't have that knowledge about aggregates ATM.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-02-23 06:09:24 Re: Sorting performance vs. MySQL
Previous Message Bruce Momjian 2010-02-23 06:00:36 Re: COPY command character set