Search Postgresql Archives

Index does not working.

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

 



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

[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