There is an interesting thread about strcoll() overhead over on -general: http://www.postgresql.org/message-id/cab25xexnondrmc1_cy3jvmb0tmydm38ef9q2d7xla0rbncj...@mail.gmail.com
My guess was that this person experienced a rather unexpected downside of spilling to disk when sorting on a text attribute: System throughput becomes very CPU bound, because tapesort tends to result in more comparisons [1]. With abbreviated keys, tapesort can actually compete with quicksort in certain cases [2]. Tapesorts of text attributes are especially bad on released versions of Postgres, and will perform very little actual I/O. In all seriousness, I wonder if we should add a release note item stating that when using Postgres 9.5, due to the abbreviated key optimization, external sorts can be much more I/O bound than in previous releases... [1] http://www.postgresql.org/message-id/20140806035512.ga91...@tornado.leadboat.com [2] http://www.postgresql.org/message-id/CAM3SWZQiGvGhMB4TMbEWoNjO17=ysb5b5y5mgqjsanq4uwt...@mail.gmail.com -- Peter Geoghegan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers