partial index on a text field

From: "Chris" <chris(at)interspire(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: partial index on a text field
Date: 2004-10-25 03:14:30
Message-ID: 001901c4ba40$d064b270$0d00a8c0@chris
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I have a text field which I'll be doing LIKE searches against so I
wanted to set up an index on it.

The data itself is too long to create a full index, so I can't just:

chris=> create index blah on ff_index(icontent);
ERROR: index row requires 21216 bytes, maximum size is 8191

So I thought I'd set up an index to use the first say 200 chars of the
string

chris=> create index blah on ff_index(substring(icontent, 0, 200));
ERROR: syntax error at or near "(" at character 40

I've tried many variations of this, same result.

I know I can create a partial index on it if the field is less than 200
chars, but that doesn't help me.

I'm running v7.4.5.

Any suggestions ?

Thanks,
Chris.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-10-25 03:56:43 Re: partial index on a text field
Previous Message Ken Tozier 2004-10-25 01:09:10 Re: Importing a tab delimited text file - How?