Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 373B2475A36 for ; Tue, 19 Mar 2002 15:50:47 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 5BCFFD5F7; Tue, 19 Mar 2002 12:50:44 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 518255BFC; Tue, 19 Mar 2002 12:50:44 -0800 (PST) Date: Tue, 19 Mar 2002 12:50:44 -0800 (PST) From: Stephan Szabo To: David Siebert Cc: Subject: Re: Yet another indexing issue. In-Reply-To: Message-ID: <20020319124955.M2427-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200203/964 X-Sequence-Number: 22333 On Tue, 19 Mar 2002, David Siebert wrote: > > I am having issues with an Index. > Here is the query > > SELECT * FROM phonecalls WHERE istatus = 0 AND (sfor = 'pat' OR > sfor='TECHIES') ORDER BY ipri DESC, dplaceddate; > I have tried '0' and jut plain 0 as well as type casting it with ::int4 . > > Here is the index I think it should use. > > CREATE INDEX phonecallspoll ON phonecalls USING btree (sfor varchar_ops, > istatus int4_ops); > But it is still doing a scan? > > Any suggestions? > yes I have used Vacumme with the anylise option. What is the schema (probably not meaningful but always helps), what does explain show for the query (specifically for the row counds), does using set enable_seqscan=off change the explain output?