Re: Multiple DB join

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: Sumeet <asumeet(at)gmail(dot)com>
Cc: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Multiple DB join
Date: 2006-08-18 15:20:19
Message-ID: 20060818152019.GB31921@phlogiston.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)crankycanuck(dot)ca
Information security isn't a technological problem. It's an economics
problem.
--Bruce Schneier

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jacobo García 2006-08-18 17:17:27 trigger needs to check in multiple tables.
Previous Message Sumeet 2006-08-18 15:07:24 Re: Multiple DB join