Why my index does not increase performance?

From: Yuri Kulaghin <c3po(at)West-Call(dot)COM>
To: pgsql-admin(at)postgresql(dot)org
Subject: Why my index does not increase performance?
Date: 1998-10-14 08:26:28
Message-ID: Pine.LNX.3.93.981014110053.8404A-100000@libra1.west-call.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message esteban rieznik 1998-10-14 13:51:03 initialize data base
Previous Message Daniele Orlandi 1998-10-13 23:33:01 Re: [ADMIN] COPY slows down; is it normal?