Re: Why do we still perform a check for pre-sorted input within qsort variants?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why do we still perform a check for pre-sorted input within qsort variants?
Дата
Msg-id 18033.1361789032@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Why do we still perform a check for pre-sorted input within qsort variants?  (Peter Geoghegan <peter.geoghegan86@gmail.com>)
Ответы Re: Why do we still perform a check for pre-sorted input within qsort variants?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Why do we still perform a check for pre-sorted input within qsort variants?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Why do we still perform a check for pre-sorted input within qsort variants?  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Peter Geoghegan <peter.geoghegan86@gmail.com> writes:
> In the past, Robert and I have criticised the fact that our qsort
> implementation (and the various specialisations thereof) each perform
> a check for pre-sorted input. This check does not appear in the
> original NetBSD qsort that we lifted our implementation from, and
> presumably isn't described by the document 'Qsort routine from Bentley
> & McIlroy's "Engineering a Sort Function"' that that implementation is
> based on.

FWIW, I've been suspicious of that pre-sorted check since the day it
went in.  Bentley was my faculty adviser for awhile in grad school,
and I know him to be *way* too smart to have missed anything as simple
as that.  But I didn't have hard evidence on which to object to it
at the time, and indeed testing seemed to say it was a good idea:
http://www.postgresql.org/message-id/18732.1142967137@sss.pgh.pa.us

If you can provide a refutation I will gladly see it out of there.
        regards, tom lane



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

Предыдущее
От: Boszormenyi Zoltan
Дата:
Сообщение: Re: Strange Windows problem, lock_timeout test request
Следующее
От: Bernd Helmle
Дата:
Сообщение: PGXS contrib builds broken?