pgsql: Improve performance of our private version of qsort.

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Improve performance of our private version of qsort.
Дата
Msg-id 20060321194915.329709DCB10@postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Improve performance of our private version of qsort.  Per recent testing,
the logic it contained to switch to insertion sort for near-sorted input was
in fact a big loss, because it could fairly easily be fooled into applying
insertion sort to large subfiles that weren't all that well ordered.  Remove
that, and instead add a simple check for already-perfectly-sorted input, as
per suggestion from Dann Corbit.  This adds at worst O(N*lgN) overhead, and
usually far less, while sometimes allowing a subfile sort to finish in O(N)
time.  Preliminary testing says this is an improvement over the basic
Bentley & McIlroy code for many nonrandom inputs, and it costs almost
nothing when the input is random.

Modified Files:
--------------
    pgsql/src/port:
        qsort.c (r1.8 -> r1.9)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/port/qsort.c.diff?r1=1.8&r2=1.9)

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

Предыдущее
От: neilc@postgresql.org (Neil Conway)
Дата:
Сообщение: pgsql: Minor refactoring: initialize_SSL() only returns 0, so it should
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Improve performance of our private version of qsort.