indices not being used - Mailing list pgsql-general

From Juuso Oikarinen
Subject indices not being used
Date
Msg-id Pine.LNX.4.10.9911180118120.5337-100000@area51.ton.tut.fi
Whole thread Raw
List pgsql-general
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



pgsql-general by date:

Previous
From: Mark Kirkwood
Date:
Subject: RE: Using functions with indexes
Next
From: The Hermit Hacker
Date:
Subject: Projects Database grows ...