Re: texteq/byteaeq: avoid detoast [REVIEW]

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>, Andy Colson <andy(at)squeakycode(dot)net>, Noah Misch <noah(at)leadboat(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: texteq/byteaeq: avoid detoast [REVIEW]
Date: 2011-01-17 07:13:28
Message-ID: AANLkTinGy6+DracG-0+V7kTuiiQUQ4rDGo3ZEjyZeAWU@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2011/1/17 Magnus Hagander <magnus(at)hagander(dot)net>:
> On Mon, Jan 17, 2011 at 06:51, Itagaki Takahiro
> <itagaki(dot)takahiro(at)gmail(dot)com> wrote:
>> On Mon, Jan 17, 2011 at 04:05, Andy Colson <andy(at)squeakycode(dot)net> wrote:
>>> This is a review of:
>>> https://commitfest.postgresql.org/action/patch_view?id=468
>>>
>>> Purpose:
>>> ========
>>> Equal and not-equal _may_ be quickly determined if their lengths are
>>> different.   This _may_ be a huge speed up if we don't have to detoast.
>>
>> We can skip detoast to compare lengths of two text/bytea values
>> with the patch, but we still need detoast to compare the contents
>> of the values.
>>
>> If we always generate same toasted byte sequences from the same raw
>> values, we don't need to detoast at all to compare the contents.
>> Is it possible or not?
>
> For bytea, it seems it would be possible.
>
> For text, I think locales may make that impossible. Aren't there
> locale rules where two different characters can "behave the same" when
> comparing them? I know in Swedish at least w and v behave the same
> when sorting (but not when comparing) in some variants of the locale.
>
> In fact, aren't there cases where the *length test* also fails? I
> don't know this for sure, but unless we know for certain that two
> different length strings can never be the same *independent of
> locale*, this whole patch has a big problem...
>

Some string's comparation operations are binary now too. But it is
question what will be new with collate support.

Regards

Pavel Stehule

> --
>  Magnus Hagander
>  Me: http://www.hagander.net/
>  Work: http://www.redpill-linpro.com/
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Itagaki Takahiro 2011-01-17 07:28:10 Re: Transaction-scope advisory locks
Previous Message Magnus Hagander 2011-01-17 06:53:15 Re: Replication logging