Re: Re: Which qsort is used

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

> -----Original Message-----
> From: pgsql-hackers-owner(at)postgresql(dot)org [mailto:pgsql-hackers-
> owner(at)postgresql(dot)org] On Behalf Of Qingqing Zhou
> Sent: Friday, December 16, 2005 5:14 PM
> To: Bruce Momjian
> Cc: Luke Lonergan; Tom Lane; Neil Conway; pgsql-hackers(at)postgresql(dot)org
> Subject: Re: [HACKERS] Re: Which qsort is used
>
> On Fri, 16 Dec 2005, Bruce Momjian wrote:
>
> >
> > 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.
> >
>
> Not necessariliy true. Dann Corbit sent me an implementation a while
ago
> (you can see it on the same site). BSD qsort is improved, though not
that
> much, by two methods. Since Dann write the program from scratch, so I
am
> not sure if we are afford to take the efforts for the improvement.

Both of them are modified versions of Bentley's sort algorithm.

I just added the in-order check to both of them, and the reversed
partition check for the second method (in the case of the subfiles
because insertion sort is allergic to reversed partitions).

At any rate, neither is much of an improvement on Bentley's version.
For the rare cases of completely ordered or completely reversed, it will
be a monumental improvement. But that is a pretty rare case.

If I could use C++, I could do much better. It is very difficult for me
to write an ADT in C instead of in C++.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-12-17 01:47:53 Re: number of loaded/unloaded COPY rows
Previous Message Qingqing Zhou 2005-12-17 01:14:17 Re: Re: Which qsort is used