Re: citext like query and index usage

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tore Halvorsen <tore(dot)halvorsen(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: citext like query and index usage
Date: 2009-09-22 18:49:22
Message-ID: 20090922184920.GG14436@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tore Halvorsen escribió:
> Hi,
>
> Is it possible to use an index for like queries on a citext column?
> I'm using pg 8.4.1 on windows - with no changes to the default configuration.
>
> For example:
>
> CREATE TABLE test ( citext citext NOT NULL );
> INSERT INTO test select md5(random()::text) FROM generate_series(0, 1000000, 1);
> CREATE INDEX test_citext_idx ON test USING btree(citext);

Hmm, I think this needs one of the *_pattern_ops indexes. I'm not sure
if you can use the builtin ones with citext though.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2009-09-22 18:52:13 Re: PLJava not installed for PostgreSQL 8.4 on Solaris 10 x86 64
Previous Message Paul M Foster 2009-09-22 18:20:47 Re: Resources for learning PostgreSQL