Re: [GENERAL] Re : Solaris Performance - Profiling (Solved)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mlw <markw(at)mohawksoft(dot)com>
Cc: Doug McNaught <doug(at)wireboard(dot)com>, Justin Clift <justin(at)postgresql(dot)org>, Mark kirkwood <markir(at)slingshot(dot)co(dot)nz>, PostgreSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] Re : Solaris Performance - Profiling (Solved)
Date: 2002-04-03 21:30:39
Message-ID: 12695.1017869439@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

mlw <markw(at)mohawksoft(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Lockhart 2002-04-03 22:26:44 Re: Suggestions please: names for function cachability
Previous Message swalker 2002-04-03 21:13:28 Re: do foreign key checks lock parent table ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2002-04-03 22:11:31 Re: Question: update and transaction isolation
Previous Message Tom Lane 2002-04-03 20:11:14 Re: notification: pg_notify ?