Sorting improvements in PostgreSQL 9.2: the case for micro-optimisation
pgeoghegan.blogspot.no
pgeoghegan.blogspot.no
[1] http://radiospiel.org/sorting-in-c-3-times-faster-than-c
PostgreSQL should really be using a radix sort for these data types, not a quick sort (however "optimized").