Re: Sorting performance vs. MySQL - Mailing list pgsql-general

From Tom Lane
Subject Re: Sorting performance vs. MySQL
Date
Msg-id 11997.1266905028@sss.pgh.pa.us
Whole thread Raw
In response to Re: Sorting performance vs. MySQL  (Yang Zhang <yanghatespam@gmail.com>)
List pgsql-general
Yang Zhang <yanghatespam@gmail.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

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: COPY command character set
Next
From: Tom Lane
Date:
Subject: Re: Sorting performance vs. MySQL