Re: Using index for "like 'ABC%'" type query

From: Andrew Sullivan <andrew(at)libertyrms(dot)info>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Using index for "like 'ABC%'" type query
Date: 2003-04-18 14:31:05
Message-ID: 20030418143104.GB26351@libertyrms.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Fri, Apr 18, 2003 at 10:56:52AM +0800, lec wrote:
> For current version of postgresql, is it possible for a query like below
> to utilize an index?
>
> select item_name from item where item_code like 'ABC%';

Yes. But locale is enabled by default now, and if you use anything
other than C (and other-than-C is increasingly the default on the
supportedplatforms), it won't work. Just make sure that your locale
is C when you do initdb.

A

--
----
Andrew Sullivan 204-4141 Yonge Street
Liberty RMS Toronto, Ontario Canada
<andrew(at)libertyrms(dot)info> M2P 2A8
+1 416 646 3304 x110

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-04-18 14:40:44 Re: Weird "template1" errors on CREATE DATABASE
Previous Message Ken Williams 2003-04-18 14:22:12 Weird "template1" errors on CREATE DATABASE

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2003-04-18 14:47:15 Re: [PERFORM] Foreign key performance
Previous Message Tom Lane 2003-04-18 14:06:27 Re: For the ametures. (related to "Are we losing momentum?")