Re: Re: Which qsort is used - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Re: Which qsort is used
Date
Msg-id 200512170108.jBH18DJ29580@candle.pha.pa.us
Whole thread Raw
In response to Re: Which qsort is used  ("Luke Lonergan" <llonergan@greenplum.com>)
Responses Re: Re: Which qsort is used  (Qingqing Zhou <zhouqq@cs.toronto.edu>)
List pgsql-hackers
Luke Lonergan wrote:
> Tom,
> 
> On 12/12/05 2:47 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:
> 
> > As those results suggest, there can be huge differences in sort
> > performance depending on whether the input is random, nearly sorted,
> > nearly reverse sorted, possesses many equal keys, etc.  It would be very
> > dangerous to say "implementation A is better than implementation B"
> > without having tested all those scenarios.
> 
> Yes.  The Linux glibc qsort is proven terrible in the general case by these
> examples though.
> 
> Bruce's point on that thread was that we shouldn't be replacing the OS
> routine in the general case.  On the other hand, there is the precedent of
> replacing Solaris' routine with the NetBSD version.

At this point, I think we have done enough testing on enough platforms
to just use port/qsort on all platforms in 8.2.  It seems whenever
someone tries to improve the BSD qsort, they make it worse.  

Were the BSD programmers geniuses and we are all idiots now, or what?

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: reducing bloat in pg_statistic
Next
From: Qingqing Zhou
Date:
Subject: Re: Re: Which qsort is used