Re: [GENERAL] interesting PHP/MySQL thread

From: Sean Chittenden <sean(at)chittenden(dot)org>
To: nolan(at)celery(dot)tssi(dot)com
Cc: Advocacy PostgreSQL <pgsql-advocacy(at)postgresql(dot)org>, PostgreSQL-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: [GENERAL] interesting PHP/MySQL thread
Date: 2003-06-23 05:44:45
Message-ID: 20030623054445.GT97131@perrin.int.nxad.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-docs 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

In response to

Browse pgsql-advocacy by date

  From Date Subject
Next Message Christopher Kings-Lynne 2003-06-23 05:54:07 Re: [GENERAL] interesting PHP/MySQL thread
Previous Message nolan 2003-06-23 05:33:51 Re: [GENERAL] interesting PHP/MySQL thread

Browse pgsql-docs by date

  From Date Subject
Next Message Christopher Kings-Lynne 2003-06-23 05:54:07 Re: [GENERAL] interesting PHP/MySQL thread
Previous Message nolan 2003-06-23 05:33:51 Re: [GENERAL] interesting PHP/MySQL thread

Browse pgsql-general by date

  From Date Subject
Next Message Christopher Kings-Lynne 2003-06-23 05:54:07 Re: [GENERAL] interesting PHP/MySQL thread
Previous Message nolan 2003-06-23 05:33:51 Re: [GENERAL] interesting PHP/MySQL thread