Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id A51F6B5DBCB for ; Mon, 20 Jun 2011 13:04:15 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 28754-10 for ; Mon, 20 Jun 2011 16:04:09 +0000 (UTC) X-Greylist: delayed 00:24:54.081885 by SQLgrey-1.7.6 Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.12.86]) by mail.postgresql.org (Postfix) with ESMTP id 2B43CB5D94C for ; Mon, 20 Jun 2011 13:04:08 -0300 (ADT) Received: FROM [192.168.0.101] (Mismatch [122.167.225.216]) By tombraider.mr.itd.umich.edu ID 4DFF6F75.4E5AF.4506 ; Authuser sushant; 20 Jun 2011 12:04:06 EDT Subject: Re: sequential scan unduly favored over text search gin index From: Sushant Sinha Reply-To: sushant354@gmail.com To: Kevin Grittner Cc: pgsql-performance@postgresql.org In-Reply-To: <4DFF27C5020000250003E9A4@gw.wicourts.gov> References: <1308584339.2488.12.camel@dragflick> <4DFF27C5020000250003E9A4@gw.wicourts.gov> Content-Type: text/plain; charset="UTF-8" Date: Mon, 20 Jun 2011 21:34:00 +0530 Message-ID: <1308585840.2488.13.camel@dragflick> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.344 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=1.553, FREEMAIL_FROM=0.001, RFC_ABUSE_POST=0.001, UNPARSEABLE_RELAY=0.001 X-Spam-Level: X-Archive-Number: 201106/182 X-Sequence-Number: 44115 On Mon, 2011-06-20 at 10:58 -0500, Kevin Grittner wrote: > Sushant Sinha wrote: > > > I have a tsvector column docvector and a gin index on it > > docmeta1_docvector_idx > > > > I have a simple query "select * from docmeta1 where docvector @@ > > plainto_tsquery('english', 'free');" > > > > I find that the planner chooses a sequential scan of the table > > even when the index performs orders of magnitude. > > Did you ANALYZE the table after loading the data and building the > index? Yes and I mentioned that the row estimates are correct, which indicate that the problem is somewhere else. -Sushant. > -Kevin