Re: Re: Which qsort is used

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Luke Lonergan <llonergan(at)greenplum(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Neil Conway <neilc(at)samurai(dot)com>, Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: Which qsort is used
Date: 2005-12-17 01:08:13
Message-ID: 200512170108.jBH18DJ29580@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Luke Lonergan wrote:
> Tom,
>
> On 12/12/05 2:47 PM, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Qingqing Zhou 2005-12-17 01:14:17 Re: Re: Which qsort is used
Previous Message Tom Lane 2005-12-16 23:23:43 Re: reducing bloat in pg_statistic