Re: indexes across multiple tables - Mailing list pgsql-general

From Ian Harding
Subject Re: indexes across multiple tables
Date
Msg-id 725602300702200651h51d76920w64d54733f65d697e@mail.gmail.com
Whole thread Raw
In response to Re: indexes across multiple tables  (Chris <dmagick@gmail.com>)
List pgsql-general
On 2/18/07, Chris <dmagick@gmail.com> wrote:
> Toby Tremayne wrote:
> > Hi all,
> >
> > I'm just experimenting with tsearch2 - I have it all working fine but I
> > was wondering if there's a way to create indexes containing vector
> > columns from multiple tables?  Or if not, how do people usually manage
> > this kind of issue?
>
> Postgres doesn't support multi-table indexes so there's no way tsearch2
> would be able to.
>
> What exactly are you trying to achieve?
>
> --

Probably best to join the tables, then simply do the search in the
WHERE clause.  Something like

select p.partname, s.subassemblyname
from part p join subassembly s
on p.partid = s.partid
where p.partidx @@ to_tsquery('Some happy string')
  or s.subidx @@ to_tsquery('Some happy string')

That's how I do it, anyway...

- Ian

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Password issue revisited
Next
From: Marek Lewczuk
Date:
Subject: Warning "TupleDesc reference leak"