Re: Indexing varchar fields with lower()

From: "Mitch Vincent" <mitch(at)huntsvilleal(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Indexing varchar fields with lower()
Date: 2000-05-05 15:32:11
Message-ID: 01b901bfb6a7$150b02a0$4100000a@venux.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Excellent, Tom. Thanks!

It went from

ipa=# explain select * from applicants as a where a.firstname ~* '^mitch'
limit 10 offset 0;
NOTICE: QUERY PLAN:

Seq Scan on applicants a (cost=0.00..1355.54 rows=98 width=599)

EXPLAIN
ipa=#

To....

ipa=# explain select * from applicants as a where lower(a.firstname) ~
lower('^mitch') limit 10 offset 0;
NOTICE: QUERY PLAN:

Index Scan using applicants_firstname on applicants a (cost=0.00..228.47
rows=98 width=599)

EXPLAIN

On 7.0 RC5.

Could putting that function in there even though it's not 'built-in' cause
any problems that you can think of? (Mainly worried about any kind of index
corruption like I've seen before)

Thanks again!

- Mitch

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2000-05-05 15:36:01 Re: pg_group_name_index corrupt?
Previous Message Hiroshi Inoue 2000-05-05 15:20:22 RE: pg_group_name_index corrupt?