Alex Pilosov <alex@pilosoft.com> writes:
> Have someone made effort to do profiling of pgsql during execution of
> certain things (inserts, selects, sorting, indices)?
Yes ...
> I have a feeling (based on stopping postgres from gdb periodically), that
> a lot of time is used in strcoll() (if table and index has string
> columns).
> Column in question is declared char(3).
> So, why's postgres collating anything at all?
Because textual comparisons are defined in terms of strcoll() if you've
enabled locale support. There is no way around this; either don't use
locales or write a faster version of strcoll().
regards, tom lane