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 A16CA30F5C6 for ; Mon, 23 Jun 2003 05:34:05 +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 85879-06 for ; Mon, 23 Jun 2003 02:33:55 -0300 (ADT) Received: from celery.tssi.com (celery.tssi.com [198.147.197.6]) by svr1.postgresql.org (Postfix) with SMTP id 6C82130F4C5 for ; Mon, 23 Jun 2003 02:33:54 -0300 (ADT) Received: (qmail 1459 invoked by uid 1000); 23 Jun 2003 05:33:52 -0000 Message-ID: <20030623053352.1457.qmail@celery.tssi.com> From: nolan@celery.tssi.com Subject: Re: [GENERAL] interesting PHP/MySQL thread To: scrappy@postgresql.org (The Hermit Hacker) Date: Mon, 23 Jun 2003 00:33:51 -0500 (CDT) Cc: scrappy@postgresql.org (The Hermit Hacker), JanWieck@Yahoo.com (Jan Wieck), pgman@candle.pha.pa.us (Bruce Momjian), josh@agliodbs.com (Josh Berkus), mail@joeconway.com (Joe Conway), pgsql-advocacy@postgresql.org (\"\"\"Advocacy PostgreSQL\"\"\"), pgsql-general@postgresql.org (PostgreSQL-general) In-Reply-To: <20030623015333.E95856@hub.org> from "The Hermit Hacker" at Jun 23, 2003 01:54:24 AM X-Mailer: ELM [version 2.5 PL3] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200306/178 X-Sequence-Number: 1390 > > 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