Re: Making strxfrm() blobs in indexes work

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Making strxfrm() blobs in indexes work
Дата
Msg-id CAM3SWZQxUnM+wHf6ngjcSqda-03jhpSbOb4+ESWXEZ7uZMZn5w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Making strxfrm() blobs in indexes work  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
On Wed, Feb 12, 2014 at 3:30 PM, Martijn van Oosterhout
<kleptog@svana.org> wrote:
> (A bit late to the party). This idea has come up before and the most
> annoying thing is that braindead strxfrm api.  Namely, to strxfrm a
> large strings you need to strxfrm it completely even if you only want
> the first 8 bytes.

I think that in general strxfrm() must have that property. However, it
does not obligate us to store the entire string, provided that we
don't trust blob comparisons that indicate equality (since I believe
that we cannot do so generally with a non-truncated blob, we might as
well take advantage of this, particularly given we're doing this with
already naturally dissimilar inner pages, where we'll mostly get away
with truncation provided there is a reliable tie-breaker).

Besides all this, I'm not particularly worried about the cost of
calling strxfrm() if that only has to occur when a page split occurs,
as we insert a downlink into the parent page. The big picture here is
that we can exploit the properties of inner pages to do the smallest
amount of work for the largest amount of benefit.


-- 
Peter Geoghegan



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

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Making strxfrm() blobs in indexes work
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: narwhal and PGDLLIMPORT