Index does not working.

Поиск
Список
Период
Сортировка
От Dan Black
Тема Index does not working.
Дата
Msg-id 27f606250506131055364e8075@mail.gmail.com
обсуждение исходный текст
Ответы Re: Index does not working.  (Douglas McNaught <doug@mcnaught.org>)
Список 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 по дате отправления:

Предыдущее
От: Hugo
Дата:
Сообщение: psql newby question, help to port Sybase ASA StoredProcedure
Следующее
От: "Jonah H. Harris"
Дата:
Сообщение: Re: [HACKERS] mirroring oracle database in pgsql