pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: gearond@cvc.net
Cc: nolan@celery.tssi.com, The Hermit Hacker <scrappy@postgresql.org>
Cc: Jan Wieck <JanWieck@Yahoo.com>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Joe Conway <mail@joeconway.com>
Cc: Advocacy PostgreSQL <pgsql-advocacy@postgresql.org>
Cc: PostgreSQL-general <pgsql-general@postgresql.org>
Subject: Re: [GENERAL] interesting PHP/MySQL thread
Date: Mon, 23 Jun 2003 12:41:55 -0400 (EDT)
Message-ID: <200306231641.h5NGftj12393@candle.pha.pa.us> (raw)
In-Reply-To: <3EF725CA.2060508@cvc.net>

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



view thread (72+ messages)  latest in thread

Message-ID: <200306231641.h5NGftj12393@candle.pha.pa.us>
Permalink:  ../200306231641.h5NGftj12393@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200306231641.h5NGftj12393@candle.pha.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: pgman@candle.pha.pa.us, gearond@cvc.net, scrappy@postgresql.org, JanWieck@Yahoo.com, josh@agliodbs.com, mail@joeconway.com, pgsql-advocacy@postgresql.org, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] interesting PHP/MySQL thread
  In-Reply-To: <200306231641.h5NGftj12393@candle.pha.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox