Re: Tsearch2 / Create rule on select

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: jm(at)poure(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Tsearch2 / Create rule on select
Date: 2007-03-09 09:58:00
Message-ID: 20070309095800.GA24205@svr2.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Mar 08, 2007 at 09:56:23PM +0100, Jean-Michel Pouré wrote:
> Dear Friends,
>
> I am very impressed by TSearch2 and would like to thank Oleg and the
> team for their hard work.
>
> I would like to migrate a phpBB forum with more that 200.000 messages to
> TSeach. Full text searches have become a bottleneck. When there are more
> than 200 users, the server slow dramatically. I need TSearch!
>
> So ... I installed TSearch2, a French dictionnary, everything is okay.
> My database is PostgreSQL 8.2.3, UTF-8.
>
> My questions now:
> 1) Should I migrate phpBB to TSeach2 in PHP code, rewriting the queries,
> which is quite obvious or easy.

Yes.

> OR
>
> 2) Is there a smart way to catch queries on the fly in PostgreSQL, for
> example using
>
> "CREATE RULE "_RETURN" AS
> ON SELECT TO t1
> DO INSTEAD "
>
> or the like.

I don't think you can do that on-the-fly. But even if you can, if it's
reasonably easy to rewrite the query in the PHP, you should do that
instead IMHO.

> 3) Gin indexes
> Are Gin indexes recommended for large databases?

Yes. At least if you have lots of search activity, they can be a *lot*
faster than GiST (see for example
http://people.planetpostgresql.org/mha/index.php?/archives/112-GIN-performance-postgresql.org-websearch-part-2.html)

> How to calculate the size in memory of an index?

No idea. Assuming you want to do it beforehand. otherwise, just create
the index and see how large it got?

//Magnus

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Monika Cernikova 2007-03-09 10:05:14 index bloat problem
Previous Message Richard Huxton 2007-03-09 09:46:37 Re: make cascade the default?