Re: how is text-equality handled in postgresql?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ivan Voras <ivoras(at)freebsd(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how is text-equality handled in postgresql?
Date: 2014-01-15 14:43:40
Message-ID: 24248.1389797020@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ivan Voras <ivoras(at)freebsd(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Amit Langote 2014-01-15 14:51:04 Re: How are pg_operator and pg_type related with each other?
Previous Message Michael Paquier 2014-01-15 14:30:34 Re: pg_basebackup failing