Re: Case sensitive searches

From: "Mario Weilguni" <mario(dot)weilguni(at)icomedias(dot)com>
To: "Jeroen T(dot) Vermeulen" <jtv(at)xs4all(dot)nl>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Case sensitive searches
Date: 2002-06-27 11:10:57
Message-ID: 4D618F6493CE064A844A5D496733D667038E78@freedom.icomedias.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>...
> if (upper('001234') == lower('001234'))
> SELECT * FROM table
> WHERE id = '001234';
> else
> SELECT * FROM table
> WHERE upper(id) = '001234';
>
>Even without the index I guess that would have saved it a lot of work.

I'm no expert, but I can't image this will be easy, because the optimizer
does not know any relation between lower() and upper().
I think an index on upper(id) (create index idxname on table(upper(id)))
should work well.

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

Browse pgsql-hackers by date

  From Date Subject
Next Message cbbrowne 2002-06-27 12:20:20 Re: Postgres idea list
Previous Message Fouad Fezzi 2002-06-27 10:57:54 encoding problem