Postgres has own implementation of qsort. It is used only for Solaris, because in some cases Solaris implementation was terrible slow.

Now, New qsort is present in the Solaris from version 9 update 6 and I performed some quick test and the speed is very similarly with pg implementation see bellow. The Solaris qsort only does not have test for preordered array.

Is it time to "remove" PG qsort and use libc version for solaris 9, 10...?

There some useful links:
solaris qsort implementation
http://cvs.opensolaris.org/source/xref/on/usr/src/common/util/qsort.c
discuss about qsort
http://momjian.postgresql.org/cgi-bin/pgtodo?qsort



                Regards Zdenek


PS: Test program is located on http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=4489885

There is test result:

mode     1      2       3       4       5       6       7       8
pg       3.440  54.259  42.251  40.967  38.214  29.730  21.668  39.142
pg2     39.492  53.598  44.697  40.546  38.027  29.572  21.598  38.756
solaris 41.207  41.957  41.873  41.616  35.895  29.502  26.906  39.492


Pg2 test is without sort array prechecking.



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

              http://archives.postgresql.org

Reply via email to