Re: qsort, once again

Поиск
Список
Период
Сортировка
От Dann Corbit
Тема Re: qsort, once again
Дата
Msg-id D425483C2C5C9F49B5B7A41F8944154757D688@postal.corporate.connx.com
обсуждение исходный текст
Ответ на qsort, once again  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> So my feeling is we should just remove the swap_cnt code and return to
> the original B&M algorithm.  Being much faster than expected for
> presorted input doesn't justify being far slower than expected for
> other inputs, IMHO.  In the context of Postgres I doubt that perfectly
> sorted input shows up very often anyway.
>
> Comments?

Checking for presorted input is O(n).
If the input is random, an average of 3 elements will be tested.
So adding an in-order check of the data should not be too expensive.

I would benchmark several approaches and see which one is best when used
in-place.



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: qsort, once again
Следующее
От: "Dann Corbit"
Дата:
Сообщение: Re: qsort, once again