Search Postgresql Archives

Re: Select time jump after adding filter; please help me figure out what I'm doing wrong.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux