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 6FDB830F660; Mon, 23 Jun 2003 16:43:37 +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 12192-05; Mon, 23 Jun 2003 13:43:27 -0300 (ADT) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id 1F16230F56A; Mon, 23 Jun 2003 13:43:24 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id h5NGftj12393; Mon, 23 Jun 2003 12:41:55 -0400 (EDT) From: Bruce Momjian Message-Id: <200306231641.h5NGftj12393@candle.pha.pa.us> Subject: Re: [GENERAL] interesting PHP/MySQL thread In-Reply-To: <3EF725CA.2060508@cvc.net> To: gearond@cvc.net Date: Mon, 23 Jun 2003 12:41:55 -0400 (EDT) Cc: nolan@celery.tssi.com, The Hermit Hacker , Jan Wieck , Josh Berkus , Joe Conway , Advocacy PostgreSQL , PostgreSQL-general X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200306/189 X-Sequence-Number: 1401 Dennis Gearon wrote: > Looks like there's some parts of that that would make a good todo. > > nolan@celery.tssi.com wrote: > > >>>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. We require ~* syntax for that, or upper()/lower(). > > 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. I would love to know how they can use an index for a non-anchored query, i.e. what string are they indexing? -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073