Обсуждение: indices not being used

Поиск
Список
Период
Сортировка

indices not being used

От
Juuso Oikarinen
Дата:
hello

I looked through a lot of previous messages, found many related
messages, but didn't find a solution to my problem.

I have a simple table of three fields,
timestamp datetime, reading1 real, and reading2 real, and
80k rows.

I have tried to create btree and hash indexes for the field timestamp, and
yes, have vacuumed it after that.

Explain still always tells me that it uses a sequential scan
for example for this simple query:

select max(timestamp) from readings;

Whis takes way too long, it takes many seconds. I would think indices
could speed this kind of simple queries tremendously.. I just don't
get postgresql to use them :(

Any suggestions?

My version of psql is 6.4.2.

rgds

          Juuso Oikarinen  http://www.students.tut.fi/~oikarine

               Hiroshima '45 - Czernobyl '86 - Windows '95