Re: improve Chinese locale performance

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: improve Chinese locale performance
Дата
Msg-id CAM-w4HMTTJDZPgn1RWm_aqs+mV7f86FvdQsCsayJ2QuC6i98nA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: improve Chinese locale performance  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: improve Chinese locale performance  (Andrew Dunstan <andrew@dunslane.net>)
Re: improve Chinese locale performance  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Mon, Jul 22, 2013 at 12:50 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> I think part of the problem is that we call strcoll for each comparison,
> instead of doing strxfrm once for each datum and then just strcmp for
> each comparison.  That is effectively equivalent to what the proposal
> implements.

Fwiw I used to be a big proponent of using strxfrm. But upon further
analysis I realized it was a real difficult tradeoff. strxrfm saves
potentially a lot of cpu cost but at the expense of expanding the size
of the sort key. If the sort spills to disk or even if it's just
memory bandwidth limited it might actually be slower than doing the
additional cpu work of calling strcoll.

It's hard to see how to decide in advance which way will be faster. I
suspect strxfrm is still the better bet, especially for complex large
character set based locales like Chinese. strcoll might still win by a
large margin on simple mostly-ascii character sets.


-- 
greg



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: [PATCH] pgbench --throttle (submission 7 - with lag measurement)
Следующее
От: Amit kapila
Дата:
Сообщение: Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])