Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id CD18E13364DE for ; Thu, 21 Oct 2010 10:27:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 48922-07 for ; Thu, 21 Oct 2010 13:27:47 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hrndva-omtalb.mail.rr.com (hrndva-omtalb.mail.rr.com [71.74.56.124]) by mail.postgresql.org (Postfix) with ESMTP id 7E9B11337B47 for ; Thu, 21 Oct 2010 10:27:45 -0300 (ADT) X-Authority-Analysis: v=1.1 cv=+c36koQ5Dcj/1qolKHjtkYAGXvrVJRRiKMp+84F5sLg= c=1 sm=0 a=Tc2gtZukA4cA:10 a=JRZeEW2aRuwA:10 a=8nJEP1OIZ-IA:10 a=RAii6je2cdnAH6ATCOpc6g==:17 a=_Ixf_7qHAAAA:8 a=dIKFWKTC5Wxg5OWULhkA:9 a=QfhCrLiJQsYTPYDj6R7qQaz3ws0A:4 a=wPNLvfGTeEIA:10 a=ryAo9hy1-OkA:10 a=6vsjEBoLwlAA:10 a=0tfO7MgyNwYA:10 a=RAii6je2cdnAH6ATCOpc6g==:117 X-Cloudmark-Score: 0 X-Originating-IP: 74.73.87.196 Received: from [74.73.87.196] ([74.73.87.196:65216] helo=[192.168.1.100]) by hrndva-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id F3/4F-24070-1DF30CC4; Thu, 21 Oct 2010 13:27:45 +0000 Message-ID: <4CC03FD0.80003@vmsinfo.com> Date: Thu, 21 Oct 2010 09:27:44 -0400 From: Mladen Gogala Reply-To: mladen.gogala@vmsinfo.com Organization: VMS User-Agent: Thunderbird 2.0.0.24 (X11/20101019) MIME-Version: 1.0 To: AI Rumman CC: "pgsql-performance@postgresql.org" Subject: Re: Index scan is not working, why?? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/341 X-Sequence-Number: 40759 AI Rumman wrote: > I don't know why seq scan is running on the following query where the > same query is giving index scan on other servers: > explain analyze > select * > from act > where act.acttype in ( 'Meeting','Call','Task'); > QUERY PLAN > ---------------------------------------------------------------------------------------------------------------------------------------- > Seq Scan on act (cost=0.00..13386.78 rows=259671 width=142) (actual > time=0.013..484.572 rows=263639 loops=1) > Filter: (((acttype)::text = 'Meeting'::text) OR ((acttype)::text = > 'Call'::text) OR ((acttype)::text = 'Task'::text)) > Total runtime: 732.956 ms > (3 rows) Al, what percentage of the rows fits the above criteria? How big are your histograms? -- Mladen Gogala Sr. Oracle DBA 1500 Broadway New York, NY 10036 (212) 329-5251 www.vmsinfo.com