Re: [PATCH] backend: compare word-at-a-time in bcTruelen

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] backend: compare word-at-a-time in bcTruelen
Дата
Msg-id 4621.1246023667@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Jeremy Kerr <jk@ozlabs.org>)
Ответы Re: [PATCH] backend: compare word-at-a-time in bcTruelen  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
Jeremy Kerr <jk@ozlabs.org> writes:
> Stephen,
>> If the updated function is always faster when the overall string is at
>> least, say, 16 characters long,

> But that's not the case - the cost of the function (and the speedup from 
> the previous version) depends on the number of spaces that there are at 
> the end.

Right, but there are certainly not more spaces than there are string
characters ;-)

I think Dimitri's idea is eminently worth trying.  In a string of less
than, say, 16 bytes, the prospects of being able to win anything get
much smaller compared to the prospects of wasting the extra loop
overhead.  There is also a DBA psychology angle to it.  If you've got
CHAR(n) for very small n, it's likely that the type is being used in the
"canonical" fashion and there won't be many trailing blanks.  The case
where we can hope to win is where we have CHAR(255) or some other
plucked-from-the-air limit.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: gettext version problem exposed by buildfarm failures on "canary"
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: query cancel issues in contrib/dblink