Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 3E9E1B5DC07 for ; Wed, 31 Aug 2011 18:54:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 57329-01; Wed, 31 Aug 2011 21:53:54 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 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 2DDDBB5DC0F; Wed, 31 Aug 2011 18:53:54 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Wed, 31 Aug 2011 16:53:53 -0500 Message-Id: <4E5E672002000025000409E7@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Wed, 31 Aug 2011 16:53:52 -0500 From: "Kevin Grittner" To: "=?ISO-8859-15?Q?Viktor=20Bojovi*?=" , , Subject: Re: function based index problem References: In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201108/248 X-Sequence-Number: 38235 Viktor Bojovi* wrote: > i don't know why it doesn't use index scan. Because it thinks your query will return 81226 rows. We need more information to make many suggestions beyond "make sure the table has been analyzed". http://wiki.postgresql.org/wiki/SlowQueryQuestions Also, it's not considered good form to post an issue to more than one PostgreSQL list. This is probably most appropriate on the pgsql-performance list, so if you want to follow up with more detail to get more detailed suggestions, it would be best to abandon this thread and start a new one on that list. -Kevin