Re: how is text-equality handled in postgresql? - Mailing list pgsql-general

From Tom Lane
Subject Re: how is text-equality handled in postgresql?
Date
Msg-id 24248.1389797020@sss.pgh.pa.us
Whole thread Raw
In response to Re: how is text-equality handled in postgresql?  (Ivan Voras <ivoras@freebsd.org>)
List pgsql-general
Ivan Voras <ivoras@freebsd.org> writes:
> On 15/01/2014 12:36, Amit Langote wrote:
>> Just to add to this, whenever strcoll() (a locale aware comparator)
>> says two strings are equal, postgres re-compares them using strcmp().

> That seems odd and inefficient. Why would it be necessary? I would think
> indexing (and other collation-sensitive operations) don't care what the
> actual collation result is for arbitrary blobs of strings, as long as
> they are stable?

If we didn't do it like this, we could not use hashing techniques for
text --- at least not unless we could find a hash function guaranteed
to yield the same values for any two strings that strcoll() claims are
equal.

            regards, tom lane


pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pg_basebackup failing
Next
From: Amit Langote
Date:
Subject: Re: How are pg_operator and pg_type related with each other?