Re: Why is sorting on two columns so slower thansortingon one column?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why is sorting on two columns so slower thansortingon one column?
Дата
Msg-id 23613.1293118017@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Why is sorting on two columns so slower thansortingon one column?  (Kenneth Marshall <ktm@rice.edu>)
Ответы Re: Why is sorting on two columns so slower thansortingon one column?  (Jie Li <jay23jack@gmail.com>)
Список pgsql-hackers
Kenneth Marshall <ktm@rice.edu> writes:
> On Thu, Dec 23, 2010 at 10:42:26PM +0800, Li Jie wrote:
>> But in the last query that sorts on "id",  since the query selects all the columns for output, the actual sorted
sizeis the same, and the only difference is the comparison cost. The query sorting on two columns needs to do twice the
comparison.Am I right?
 

> I think you are right. Sorry for the confusion.

I doubt the cost of comparing two integers is the issue here; rather
it's more likely one of how many merge passes were needed.  You could
find out instead of just speculating by turning on trace_sort and
comparing the log outputs.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Quan Zongliang
Дата:
Сообщение: Re: Patch BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Streaming replication as a separate permissions