Re: [GENERAL] interesting PHP/MySQL thread

From: nolan(at)celery(dot)tssi(dot)com
To: scrappy(at)postgresql(dot)org (The Hermit Hacker)
Cc: scrappy(at)postgresql(dot)org (The Hermit Hacker), JanWieck(at)Yahoo(dot)com (Jan Wieck), pgman(at)candle(dot)pha(dot)pa(dot)us (Bruce Momjian), josh(at)agliodbs(dot)com (Josh Berkus), mail(at)joeconway(dot)com (Joe Conway), pgsql-advocacy(at)postgresql(dot)org (\"\"\"Advocacy PostgreSQL\"\"\"), pgsql-general(at)postgresql(dot)org (PostgreSQL-general)
Subject: Re: [GENERAL] interesting PHP/MySQL thread
Date: 2003-06-23 05:33:51
Message-ID: 20030623053352.1457.qmail@celery.tssi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy pgsql-docs pgsql-general

> > 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';"

That will match values with any combination of upper and lower case
letters that fold to 'nolan': 'Nolan', 'NOLAN', etc.

Also, unlike PostgreSQL (at least in 7.3), if you define an index on
the column, mysql appears to use it for LIKE queries.

"SELECT * FROM table WHERE field LIKE 'nolan%';"

is very fast in mysql but not in 7.3, and even non-anchored LIKE searches
in mysql appear to be using the index.

"SELECT * FROM table WHERE field LIKE '%nolan%';"

executes considerably faster with an index on field than without one.
--
Mike Nolan

In response to

Responses

Browse pgsql-advocacy by date

  From Date Subject
Next Message Sean Chittenden 2003-06-23 05:44:45 Re: [GENERAL] interesting PHP/MySQL thread
Previous Message Steve Lane 2003-06-23 05:25:23 Re: [GENERAL] interesting PHP/MySQL thread

Browse pgsql-docs by date

  From Date Subject
Next Message Sean Chittenden 2003-06-23 05:44:45 Re: [GENERAL] interesting PHP/MySQL thread
Previous Message Steve Lane 2003-06-23 05:25:23 Re: [GENERAL] interesting PHP/MySQL thread

Browse pgsql-general by date

  From Date Subject
Next Message Sean Chittenden 2003-06-23 05:44:45 Re: [GENERAL] interesting PHP/MySQL thread
Previous Message Steve Lane 2003-06-23 05:25:23 Re: [GENERAL] interesting PHP/MySQL thread