Re: Queryplan within FTS/GIN index -search.

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <jesper(at)krogh(dot)cc>,<tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-performance(at)postgresql(dot)org>,<oleg(at)sai(dot)msu(dot)su>, <teodor(at)sigaev(dot)ru>
Subject: Re: Queryplan within FTS/GIN index -search.
Date: 2009-11-02 22:06:00
Message-ID: 4AEF0369020000250002C183@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Any sane text search application is going to try to filter out
> common words as stopwords; it's only the failure to do that that's
> making this run slow.

Imagine a large table with a GIN index on a tsvector. The user wants
a particular document, and is sure four words are in it. One of them
only appears in 100 documents. The other three each appear in about
a third of the documents. Is it more sane to require the user to
wait for a table scan or to make them wade through 100 rows rather
than four?

I'd rather have the index used for the selective test, and apply the
remaining tests to the rows retrieved from the heap.

-Kevin

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2009-11-03 00:18:02 Re: Queryplan within FTS/GIN index -search.
Previous Message Robert Haas 2009-11-02 20:34:27 Re: database size growing continously