Re: [pgsql-advocacy] interesting PHP/MySQL thread - Mailing list pgsql-general

From Sean Chittenden
Subject Re: [pgsql-advocacy] interesting PHP/MySQL thread
Date
Msg-id 20030623054445.GT97131@perrin.int.nxad.com
Whole thread Raw
In response to Re: [pgsql-advocacy] interesting PHP/MySQL thread  (nolan@celery.tssi.com)
List pgsql-general
[ Please stop cross posting emails between mailing lists! ]

> > > Personally, if I want case insensitivity, I'll WRITE IT INTO THE CODE,
> > > but I can see how some people might think that 'NOLAN', 'Nolan' and
> > > 'nolan' should be considered as the same data.
> >
> > Oh, you mean like "SELECT * FROM table WHERE field ~* 'nolan';"?
>
> No, I mean as in "SELECT * FROM table WHERE field = 'nolan';"

CREATE INDEX table_field_lower_idx ON table (LOWER(field));
VACUUM ANALYZE table;
SELECT * FROM table WHERE LOWER(field) = LOWER('nolan');
SELECT * FROM table WHERE field ILIKE 'nolan%';


ILIKE is case insensitive LIKE.

http://developer.postgresql.org/docs/postgres/functions-matching.html#FUNCTIONS-LIKE

This is likely an FAQ for new MySQL users at this point, or should be
if it's not.

If you are still having performance problems with the above solutions,
please send an EXPLAIN ANALYZE to the performance@ list so we can
figure out what's going on.  -sc

--
Sean Chittenden

pgsql-general by date:

Previous
From: nolan@celery.tssi.com
Date:
Subject: Re: [pgsql-advocacy] interesting PHP/MySQL thread
Next
From: Bruce Momjian
Date:
Subject: Re: Thousands of semops for every i/o