Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 3774A6327C2 for ; Tue, 3 Nov 2009 11:35:57 -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 41425-06 for ; Tue, 3 Nov 2009 15:35:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 8C330632797 for ; Tue, 3 Nov 2009 11:35:46 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id nA3FZiaV004731; Tue, 3 Nov 2009 10:35:44 -0500 (EST) To: "Kevin Grittner" cc: jesper@krogh.cc, pgsql-performance@postgresql.org, oleg@sai.msu.su, teodor@sigaev.ru Subject: Re: Queryplan within FTS/GIN index -search. In-reply-to: <4AEFF056020000250002C195@gw.wicourts.gov> References: <4AEF0369020000250002C183@gw.wicourts.gov><4AEF0369020000250002C183@gw.wicourts.gov> <11587.1257207482@sss.pgh.pa.us> <4AEFF056020000250002C195@gw.wicourts.gov> Comments: In-reply-to "Kevin Grittner" message dated "Tue, 03 Nov 2009 08:56:53 -0600" Date: Tue, 03 Nov 2009 10:35:44 -0500 Message-ID: <4730.1257262544@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.546 tagged_above=-10 required=5 tests=AWL=0.053, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200911/20 X-Sequence-Number: 36188 "Kevin Grittner" writes: > Perhaps I'm missing something. My point was that there are words > which are too common to be useful for index searches, yet uncommon > enough to usefully limit the results. These words could typically > benefit from tsearch2 style parsing and dictionaries; so declaring > them as stop words would be bad from a functional perspective, yet > searching an index for them would be bad from a performance > perspective. Right, but the original complaint in this thread was that a GIN index is slow about searching for very common terms. The answer to that clearly is to not index common terms, rather than worry about making the case a bit faster. It may well be that Jesper's identified a place where the GIN code could be improved --- it seems like having the top-level search logic be more aware of the AND/OR structure of queries would be useful. But the particular example shown here doesn't make a very good case for that, because it's hard to tell how much of a penalty would be taken in more realistic examples. regards, tom lane