Yet another indexing issue. - Mailing list pgsql-general

From David Siebert
Subject Yet another indexing issue.
Date
Msg-id OJEIJALIHAIBMMBFLCOBAENOEDAA.david@eclipsecat.com
Whole thread Raw
In response to Re: [SQL] Why is it not using an index?  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: Yet another indexing issue.  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
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.
Thanks for any info.


pgsql-general by date:

Previous
From: "Andrew G. Hammond"
Date:
Subject: Re: [SQL] How to create crude report with psql and/or plpgsql
Next
From: Richard Emberson
Date:
Subject: PL/pgsql procedure lookup speed