Re: [GENERAL] Re : Solaris Performance - Profiling (Solved) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Re : Solaris Performance - Profiling (Solved)
Date
Msg-id 12695.1017869439@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Re : Solaris Performance - Profiling (Solved)  (mlw <markw@mohawksoft.com>)
List pgsql-hackers
mlw <markw@mohawksoft.com> writes:
> quicksort is a pretty poor algorithm if your data is in some kind of order
> already.

Only if you fail to take standard precautions against making a bad
choice of pivot element; every discussion I've ever seen of quicksort
explains ways to avoid that pitfall.  Solaris' problem seems to be a
more subtle issue having to do with large numbers of equal keys.  The
form of quicksort that Knuth presents is tuned to behave well in that
situation, at the cost of exchanging equal records (cf. his exercise
5.2.2.18) ... perhaps Sun overlooked that particular hack, or got it
wrong.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: timeout implementation issues
Next
From: mlw
Date:
Subject: Re: Suggestions please: names for function cachability attributes