Re: 7.3 no longer using indexes for LIKE queries

From: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
To: Matthew Gabeler-Lee <mgabelerlee(at)zycos(dot)com>
Cc: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: 7.3 no longer using indexes for LIKE queries
Date: 2002-12-04 20:24:53
Message-ID: 3DEE6495.16E9C4EE@nsd.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

C_COLLATE is what is involved with accents.

How would you sort:

CÔTE
CÔTES
COTÉ
COTÉS
COTE

You can't fold accented character into non accented because unique index
would barf on CÔTE if COTE is already in.

You still need to know if 'CÔTE' < 'COTÉ' or not when you do a sort.

Collating in french, for example, is not a byte to byte compare.

If you compare words based only on their binary representation, the sort
will be wrong
CRIME before CÔTE.

JLL

Matthew Gabeler-Lee wrote:

> 4) accent folding; I'm not entirely sure like is supposed to do this. I'm
> going to pretend for the rest of this that the like operator shouldn't fold
> accented characters.
>
> [...]
>
> It seems to me that the most common place one wants to think about this is
> in full text searching and the like. In this case, maybe I'm daft, but
> perhaps the thing to do is to create a functional index, where the function
> being indexed strips all the accents off characters.
>
> Does the SQL spec have anything to say on accent folding in comparisons?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew J. Kopciuch 2002-12-04 20:25:43 Re: Functions just dont want to work! [hard]
Previous Message Matthew Gabeler-Lee 2002-12-04 20:12:33 Query breaking with unknown expression type (lost subquery from v iew?)