Internal Sort for PostgreSQL Usage Pattern

http://archives.postgresql.org/pgsql-hackers/2005-12/msg00610.php

Here is the program (based on Luke's work):

    sort.c
    timing.c
    qsortB.c
    qsortG.c
    Makefile

as a tar ball.

Here is the test results:

  1. Linux, gcc 2.96, 2.4G P4
  2. WinXp, gcc 3.4.2(mingw-special), .8G P3
  3. SunOS, gcc 2.95.2, Sun Blade 1000
  4. [Jim Nasby] Solaris10, ,Ultra5
  5. [Jim Nasby] FreeBSD6, , Atholon64
  6. [Jim Nasby] FreeBSD4.11, , P2
  7. [Jim Nasby] Solaris10, , Operon
  8. [Jim Nasby] Solaris9, , Ultra5
  9. [Jesper Pedersen] Suse 10, gcc 4.0.2, AMD Turion ML-28 (1.6G)
  10. [Jeff Trout] OSX, ,Dule2 G5 2.5G
  11. [Jeff Trout] OSX, ,iBook G4 .933G
  12. [Mark Kirkwood]FreeBSD6.0, ,x86 .8G
  13. [Rocco Altier]AIX, ,

Here is Dann Corbit's version of qsort:

qsortb.c is the BSD qsort. 
qsort.c is Plauger's introspective sort. 
qsb.c is qsortb.c with a check for in-order data. 
qsortpdq.c is a modified version of qsortb.c with in-order and reversed checks.