Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] interesting PHP/MySQL thread

From: Dennis Gearon <gearond(at)cvc(dot)net>
To: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
Cc: nolan(at)celery(dot)tssi(dot)com,The Hermit Hacker <scrappy(at)postgresql(dot)org>,Jan Wieck <JanWieck(at)Yahoo(dot)com>,Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,Josh Berkus <josh(at)agliodbs(dot)com>, Joe Conway <mail(at)joeconway(dot)com>,"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 16:36:08
Message-ID: 3EF72C78.60300@cvc.net (view raw or flat)
Thread:
Lists: pgsql-advocacypgsql-docspgsql-general
lower's probably faster, since most characters are lower already.

Lincoln Yeoh wrote:
> At 12:33 AM 6/23/2003 -0500, nolan(at)celery(dot)tssi(dot)com wrote:
> 
>> >
>> > 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.
> 
> 
> For me that's a matter of taste. I prefer to use = for case sensitive 
> and lower(field)=lower('data') for case insensitive. I wonder if there 
> is a difference between using lower vs upper for case insensitivity but 
> I've never bothered to look deeply into it.
> 
> 
>> 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.
> 
> 
> The versions of Postgresql I've used since I can remember (e.g. at least 
> v6.5.3 some years ago) use indexes for anchored LIKE searches.
> 
> I vaguely recall some people having this "not using index" behaviour 
> when they are using various locales.
> 
> 
>>    "SELECT * FROM table WHERE field LIKE '%nolan%';"
>>
>> executes considerably faster with an index on field than without one.
> 
> 
> I think MySQL wins in this one. Just wondering how they do it. And 
> whether it's a good idea to do it that way.
> 
> Regards,
> Link.
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
> 


In response to

pgsql-docs by date

Next:From: Bruce MomjianDate: 2003-06-23 16:41:55
Subject: Re: [GENERAL] interesting PHP/MySQL thread
Previous:From: Dennis GearonDate: 2003-06-23 16:07:38
Subject: Re: [GENERAL] interesting PHP/MySQL thread

pgsql-advocacy by date

Next:From: Bruce MomjianDate: 2003-06-23 16:41:55
Subject: Re: [GENERAL] interesting PHP/MySQL thread
Previous:From: Hans-Jürgen SchönigDate: 2003-06-23 16:24:32
Subject: dblink for Oracle - question ...

pgsql-general by date

Next:From: Bruce MomjianDate: 2003-06-23 16:41:55
Subject: Re: [GENERAL] interesting PHP/MySQL thread
Previous:From: Nailah OgeerDate: 2003-06-23 16:13:58
Subject: SHM_QUEUE

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group