X-Original-To: pgsql-advocacy-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id CFE7E30F577; Mon, 23 Jun 2003 16:45:57 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 12242-06; Mon, 23 Jun 2003 13:45:47 -0300 (ADT) Received: from snoopy.oit.edu (snoopy.OIT.EDU [140.211.135.12]) by svr1.postgresql.org (Postfix) with ESMTP id B879430F671; Mon, 23 Jun 2003 13:45:46 -0300 (ADT) Received: from cvc.net (purvine-141-62.oit.edu [140.211.141.62]) by snoopy.oit.edu (8.12.9/8.12.9/OIT-4.0) with ESMTP id h5NGWJWD005170; Mon, 23 Jun 2003 09:32:20 -0700 Message-ID: <3EF72C78.60300@cvc.net> Date: Mon, 23 Jun 2003 09:36:08 -0700 From: Dennis Gearon Reply-To: gearond@cvc.net User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4b) Gecko/20030507 X-Accept-Language: en-us, ru MIME-Version: 1.0 To: Lincoln Yeoh Cc: nolan@celery.tssi.com, The Hermit Hacker , Jan Wieck , Bruce Momjian , Josh Berkus , Joe Conway , "Advocacy PostgreSQL" , PostgreSQL-general Subject: Re: [GENERAL] interesting PHP/MySQL thread References: <20030623015333.E95856@hub.org> <5.2.1.1.1.20030623221452.02f7fd48@mbox.jaring.my> In-Reply-To: <5.2.1.1.1.20030623221452.02f7fd48@mbox.jaring.my> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200306/190 X-Sequence-Number: 1402 lower's probably faster, since most characters are lower already. Lincoln Yeoh wrote: > At 12:33 AM 6/23/2003 -0500, nolan@celery.tssi.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@postgresql.org >