Andrew Edson wrote:
> The following is a copy of my index creation statement, index name, and explain and explain analyze output on the statement I was trying to run. Would someone please help me figure out what I'm doing wrong here?
>
> > attest=# create index ptrans_cid_trandt_idx on ptrans(cntrct_id, tran_dt) where rcrd_cd = '0A';
>> attest=# explain select cntrct_id, tran_dt from ptrans where rcrd_cd = 0;
>> attest=# explain analyze select cntrct_id, tran_dt from ptrans where rcrd_cd = 0;
The index has a where clause that doesn't match your query. It wouldn't
use the index anyway - you're not filtering or sorting on it.
--
Richard Huxton
Archonet Ltd