Re: Need to improve performance - Mailing list pgsql-sql

From Mitch Vincent
Subject Re: Need to improve performance
Date
Msg-id 006d01bfdd22$d3129460$0300000a@doot.org
Whole thread Raw
In response to Need to improve performance  (Vassili A Akimov <vassili@erols.com>)
List pgsql-sql
> vacuum;
> vacuum analyze;
> select f1.id from app_fti f1, app_fti f2 where f1.string~*'visual' and
> f2.string~*'basic' and f1.id=f2.id;

Use ~*'^basic'

It will use the indexes I believe. Also, enable likeplanning (look in
contrib/likeplanning) -- it will speed things up too.. If that doesn't help
then use EXPLAIN to get your query plan and post it, I'll try to help
further... I'm doing this exact thing, so have some experience on tweaking
it (Thanks again Tom!)  :-)

I'd bet what's happening is you're doing a seq scan, not something you want
to do on that big of a table. (I know that's what's happening with using
~*'whatever' )

Make good use of the stop words in fti.c too (be sure to order them, it's a
binary search).

Hope that helps..


-Mitch




pgsql-sql by date:

Previous
From: Vassili A Akimov
Date:
Subject: Need to improve performance
Next
From: Jeff Hoffmann
Date:
Subject: Re: Merging two columns into one