Re: Multiple DB join - Mailing list pgsql-sql

From Andrew Sullivan
Subject Re: Multiple DB join
Date
Msg-id 20060818152019.GB31921@phlogiston.dyndns.org
Whole thread Raw
In response to Re: Multiple DB join  (Sumeet <asumeet@gmail.com>)
List pgsql-sql
On Fri, Aug 18, 2006 at 11:07:24AM -0400, Sumeet wrote:
> 
> Will the full text search indexing help me achive a good speed in searching
> keywords???

I think this depends on how you use it.

> can someone plz ellaborate a little about ways we can enforce bounded
> searches?. I'm basically trying a simple search
> i.e. trying to find name of authors user enters into a interface against the
> 20 miliions records in my db. Can anyone suggest a good way to perform this
> kind of search ?.

The thing is, if they're keywords, why are you treating them as
fragments?  Traditionally, keywords are not substrings, but full
barewords.  A bareword match should be fast, because it's looking for
the whole string.  So you shouldn't need the "%" characters.

Maybe the problem that you have something like the following.  If
your data is stored like this

subject     |  keyword
subject1    |  keyword1 keyword2 keyword3

and you want every subject that matches on keyword2, then you have to
search this with SELECT subject WHERE keyword = '%keyword2%'.  The
reason you have to do that is that your data is badly normalised.  Is
that it?

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
Information security isn't a technological problem.  It's an economics
problem.    --Bruce Schneier


pgsql-sql by date:

Previous
From: Sumeet
Date:
Subject: Re: Multiple DB join
Next
From: "Jacobo García"
Date:
Subject: trigger needs to check in multiple tables.