Re: Can LIKE use indexes or not?

From: "Uwe C(dot) Schroeder" <uwe(at)oss4u(dot)com>
To: johnsw(at)wardbrook(dot)com
Cc: "David Garamond" <lists(at)zara(dot)6(dot)isreserved(dot)com>, "pgsql-general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Can LIKE use indexes or not?
Date: 2004-02-06 19:44:48
Message-ID: 200402061144.48464.uwe@oss4u.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Why don't you use

select * from t where new_upper_f ilike 'mmm%';

The ilike operator ignores case and you would get rid of the function call.

On Thursday 05 February 2004 01:20 am, John Sidney-Woollett wrote:
> John Sidney-Woollett said:
> > select * from t where new_upper_f like upper('MMM%');
>
> I think I meant
>
> select * from t where new_upper_f like 'MMM%';
>
> or
>
> select * from t where new_upper_f like upper('mmm%');
>
> John
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

- --
UC

- --
Open Source Solutions 4U, LLC 2570 Fleetwood Drive
Phone: +1 650 872 2425 San Bruno, CA 94066
Cell: +1 650 302 2405 United States
Fax: +1 650 872 2417
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAI+6wjqGXBvRToM4RAgY8AKCmTr8JQpbDd+FMEZCG1ITVIYH+CQCeJ45C
IHZxeLxj60UL+TlhXfH6pdM=
=JOOY
-----END PGP SIGNATURE-----

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Mascari 2004-02-06 20:00:41 Re: Run 2 versions of Postgresql on one machine?
Previous Message Richard Huxton 2004-02-06 19:32:20 Re: Run 2 versions of Postgresql on one machine?