Re: indexing large "text" attributes ... ERROR: maximum size is 8191

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Benjamin Arai <me(at)benjaminarai(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: indexing large "text" attributes ... ERROR: maximum size is 8191
Date: 2007-08-06 02:37:06
Message-ID: 9164.1186367826@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Benjamin Arai <me(at)benjaminarai(dot)com> writes:
> The tsearch2 webpage says to do something like

> SELECT intindex, strTopic FROM tblmessages
> WHERE idxfti @@ to_tsquery('default', 'gettysburg &
> address')
> AND strMessage ~* '.*men are created equal.*';
> intindex | strtopic
> ----------+------------------------------
> 6 | Gettysburg address quotation
> (1 row)

Right.

> Which would mean I would have to create index on strMessage. Right?

Wrong. A btree index on strMessage is utterly worthless for checking
that pattern match, and even if it did work, there's no point in using
a second index to check it rather than fetching the heap entry.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message hanasaki 2007-08-06 03:21:13 Re: HA, failover and load balancing / howto?
Previous Message Benjamin Arai 2007-08-06 02:23:12 Re: indexing large "text" attributes ... ERROR: maximum size is 8191