Andrew Dunstan <and...@dunslane.net> writes: > First, this apparently only affects build done with NLS. And in fact > even on release 11 the performance is much better when run on a non-NLS > build. So there's lots of work to do here.
Wow ... it would not have occurred to me to check that. Testing that angle using HEAD on Linux (RHEL8), here are times I see for the OP's slow query: Non-NLS build, C locale: Time: 12452.062 ms (00:12.452) NLS build, en_US.utf8 locale: Time: 13596.114 ms (00:13.596) NLS build, after SET lc_messages TO 'es_ES.utf8': Time: 15190.689 ms (00:15.191) So there is a cost for translating the error messages on Linux too, but it's not nearly as awful as on Windows. I wonder if this boils down to a performance bug in the particular gettext version you're using? regards, tom lane