Re: Functional Index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: Alexander Presber <aljoscha(at)weisshuhn(dot)de>, pgsql-general(at)postgresql(dot)org
Subject: Re: Functional Index
Date: 2006-11-22 16:24:33
Message-ID: 1294.1164212673@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> writes:
> On Wed, 22 Nov 2006, Alexander Presber wrote:
>> CREATE INDEX idx_main_subject ON pdb.main (lower(main_subject::text)
>> using varchar_ops);

> IIRC, unless you're in C locale, you'll want varchar_pattern_ops rather
> than varchar_ops on the index to make it considered for a LIKE search.

text_pattern_ops would be better, seeing that the output of lower() is
text not varchar. I'm a bit surprised the planner is able to make use
of this index at all.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tony Caduto 2006-11-22 16:30:21 Re: Data transfer between databases over the Internet
Previous Message Alvaro Herrera 2006-11-22 16:23:13 Re: MSSQL to PostgreSQL : Encoding problem