Why is it not using an index?

Поиск
Список
Период
Сортировка
От Dmitry Tkach
Тема Why is it not using an index?
Дата
Msg-id 3C924680.4090806@openratings.com
обсуждение исходный текст
Ответы Re: Why is it not using an index?  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-sql
This must be really simple, but I just can't get it :-(
I have a table (a) with a single column (x):

           Table "a"
  Attribute |   Type   | Modifier
-----------+----------+----------
  x         | smallint |
Index: a_idx


    Index "a_idx"
  Attribute |   Type
-----------+----------
  x         | smallint
btree

The table has 10000000 rows....

Now, how come, when I do:

explain select * from a where x=3;

it says:

Seq Scan on bset  (cost=100000000.00..100175934.05 rows=303 width=2)

Why is it not using a_idx???

I even tried set enable_seqscan to off - makes no difference :-(

Any idea what is going on?

Thanks a lot!

Dima


В списке pgsql-sql по дате отправления:

Предыдущее
От: Dmitry Tkach
Дата:
Сообщение: Re: Btree index extension question
Следующее
От: Frederick Klauschen
Дата:
Сообщение: JDBC for J2ME