Index does not working. - Mailing list pgsql-general

From Dan Black
Subject Index does not working.
Date
Msg-id 27f606250506131055364e8075@mail.gmail.com
Whole thread Raw
Responses Re: Index does not working.  (Douglas McNaught <doug@mcnaught.org>)
List pgsql-general
I created a table

CREATE TABLE my_table
(
  id int4 NOT NULL,
  name varchar(64) NOT NULL,
  deleted bool NOT NULL,
  active bool NOT NULL,
  CONSTRAINT my_table_pkey PRIMARY KEY (id)
)

and  index

CREATE INDEX my_table_index
  ON my_table
  USING btree
  (deleted, active);


there is two identical queries...

1) select * from my_table where active and deleted

and

2) select * from my_table where active = true and deleted = true

First query does not use index in contrast to two query.

Why?

Thanks.
--
Verba volent, scripta manent
My ISP  - http://www.netbynet.ru

pgsql-general by date:

Previous
From: Hugo
Date:
Subject: psql newby question, help to port Sybase ASA StoredProcedure
Next
From: "Jonah H. Harris"
Date:
Subject: Re: [HACKERS] mirroring oracle database in pgsql