Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WcbDa-0003N8-70 for pgsql-performance@arkaria.postgresql.org; Tue, 22 Apr 2014 13:58:38 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WcbDZ-0008Rn-Kx for pgsql-performance@arkaria.postgresql.org; Tue, 22 Apr 2014 13:58:37 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WcbDY-0008Rh-QG for pgsql-performance@postgresql.org; Tue, 22 Apr 2014 13:58:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WcbDV-0001aP-2G for pgsql-performance@postgresql.org; Tue, 22 Apr 2014 13:58:35 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s3MDwUYj026990; Tue, 22 Apr 2014 09:58:30 -0400 From: Tom Lane To: Heikki Linnakangas cc: obartunov@gmail.com, Laurence Parry , pgsql-performance@postgresql.org Subject: Re: Workaround: Planner preference for tsquery filter vs. GIN index in fast text search In-reply-to: <53560C07.80207@vmware.com> References: <53560C07.80207@vmware.com> Comments: In-reply-to Heikki Linnakangas message dated "Tue, 22 Apr 2014 09:28:23 +0300" Date: Tue, 22 Apr 2014 09:58:30 -0400 Message-ID: <26989.1398175110@sss.pgh.pa.us> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Heikki Linnakangas writes: > On 04/20/2014 07:46 AM, Oleg Bartunov wrote: >> btw, 9.4 should be wiser in case of rare+common terms, thanks to GIN >> fast scan feature. > Indeed, although we didn't actually do anything to the planner to make > it understand when fast scan helps. The given query has nothing to do with rare+common terms, since there is only one term in the search --- and what's more, the planner's estimate for that term is spot on already (755 estimated matches vs 752 actual). It looks to me like the complaint is more probably about inappropriate choice of join order; but since we've been allowed to see only some small portion of either the query or the plan, speculating about the root cause is a fool's errand. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance