Re: [GENERAL] Multicolumn index including tsvector.

2009-11-24 Thread Alban Hertroys
On 24 Nov 2009, at 24:08, Kris Gale wrote: > Table "public.example" > Column | Type | Modifiers > -+--+--- > body| text | > vectors | tsvector | > user_id | bigint | > > I've got btree_gin and btree_gist installed, so I can make a composite inde

Re: [GENERAL] Multicolumn index including tsvector.

2009-11-23 Thread Kris Gale
> > > explain analyze select body from example where user_id=1 and vectors @@ > > to_tsquery('simple', 'when') limit 10; > > Try coercing the '1' to a bigint. I don't believe the btree_gist > opclasses have any support for cross-type operators. > Perfect! Thanks, Tom. The query plan now shows i

Re: [GENERAL] Multicolumn index including tsvector.

2009-11-23 Thread Tom Lane
Kris Gale writes: > So what I'm expecting here is that it'll be able to use one of those > composite indexes to satisfy both the user_id and the vectors constraints. > That doesn't seem to be the case, based on this query plan: > explain analyze select body from example where user_id=1 and vector