Re: Queryplan within FTS/GIN index -search.

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Jesper Krogh" <jesper(at)krogh(dot)cc>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Queryplan within FTS/GIN index -search.
Date: 2009-10-22 18:51:30
Message-ID: 4AE06362020000250002BDFD@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Jesper Krogh <jesper(at)krogh(dot)cc> wrote:

> I'm searching the gin-index for 1-5 terms, where all of them matches
> the same document. TERM1 is unique by itself, TERM2 is a bit more
> common (52 rows), TERM3 more common, TERM4 close to all and TERM5
> all records.

> Recheck Cond: (ftsbody_body_fts @@ to_tsquery('TERM1
> & TERM2 & TERM3 & TERM4 & TERM5'::text))
> -> Bitmap Index Scan on ftsbody_tfs_idx
> (cost=0.00..100.42 rows=1 width=0) (actual time=1508.998..1508.998
> rows=1 loops=1)
> Index Cond: (ftsbody_body_fts @@
> to_tsquery('TERM1 & TERM2 & TERM3 & TERM4 & TERM5'::text))
> Total runtime: 1509.109 ms

> Can this be optimized? (I cannot really prevent users from typing
> stuff in that are common).

I've wondered that myself. Perhaps a term which is ANDed with others
and is too common could be dropped from the Index Cond and just left
in the Recheck Cond?

-Kevin

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2009-10-22 19:25:05 Re: Table Clustering & Time Range Queries
Previous Message Kevin Buckham 2009-10-22 18:50:44 Table Clustering & Time Range Queries