Why my index does not increase performance? - Mailing list pgsql-admin

From Yuri Kulaghin
Subject Why my index does not increase performance?
Date
Msg-id Pine.LNX.3.93.981014110053.8404A-100000@libra1.west-call.com
Whole thread Raw
Responses Re: [ADMIN] Why my index does not increase performance?
List pgsql-admin
Hi, All!

My database has a big table (more 1 million records) that contains
a date field. This field has approximately 150 unique values (dates
of five monthes) per table. I created index as follow:

    create index mytable_ind on mytable (mydate date_ops);

Next, I perform following query:

    select max(mydate) from mytable;

And time length of this query is about 100 seconds! I think postgres
looks up ALL records in the table to find max value and does not use
created index. Why? Database is vacuumed, PostgreSQL 6.3.2 on Solaris
2.5.1/x86, CPU P166, RAM 64 Mb.

Yuri.


pgsql-admin by date:

Previous
From: Daniele Orlandi
Date:
Subject: Re: [ADMIN] COPY slows down; is it normal?
Next
From: "Gilley, Charles H."
Date:
Subject: re: binary/build woes, procedural question