Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 940EC63239D for ; Mon, 2 Nov 2009 18:06:15 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 41126-04 for ; Mon, 2 Nov 2009 22:06:00 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id DCD0E632ACD for ; Mon, 2 Nov 2009 18:06:04 -0400 (AST) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Mon, 02 Nov 2009 16:06:03 -0600 Message-Id: <4AEF0369020000250002C183@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.0 Date: Mon, 02 Nov 2009 16:06:00 -0600 From: "Kevin Grittner" To: , Cc: ,, Subject: Re: Queryplan within FTS/GIN index -search. Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.59 tagged_above=-10 required=5 tests=AWL=0.009, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200911/16 X-Sequence-Number: 36184 Tom Lane 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