pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lincoln Yeoh <lyeoh@pop.jaring.my>
To: nolan@celery.tssi.com
To: scrappy@postgresql.org
Cc: scrappy@postgresql.org
Cc: JanWieck@Yahoo.com
Cc: pgman@candle.pha.pa.us
Cc: josh@agliodbs.com
Cc: mail@joeconway.com
Cc: pgsql-advocacy@postgresql.org
Subject: Re: [GENERAL] interesting PHP/MySQL thread
Date: Mon, 23 Jun 2003 22:23:23 +0800
Message-ID: <5.2.1.1.1.20030623221452.02f7fd48@mbox.jaring.my> (raw)
In-Reply-To: <20030623053352.1457.qmail@celery.tssi.com>
References: <20030623015333.E95856@hub.org>

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.




view thread (72+ messages)  latest in thread

Message-ID: <5.2.1.1.1.20030623221452.02f7fd48@mbox.jaring.my>
Permalink:  ../5.2.1.1.1.20030623221452.02f7fd48@mbox.jaring.my/
Also on:    postgresql.org/message-id/5.2.1.1.1.20030623221452.02f7fd48@mbox.jaring.my

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-docs@postgresql.org
  Cc: lyeoh@pop.jaring.my, nolan@celery.tssi.com, scrappy@postgresql.org, JanWieck@Yahoo.com, pgman@candle.pha.pa.us, josh@agliodbs.com, mail@joeconway.com, pgsql-advocacy@postgresql.org
  Subject: Re: [GENERAL] interesting PHP/MySQL thread
  In-Reply-To: <5.2.1.1.1.20030623221452.02f7fd48@mbox.jaring.my>
  References: <20030623015333.E95856@hub.org> <5.2.1.1.1.20030623221452.02f7fd48@mbox.jaring.my>

* 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