Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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.



pgsql-admin by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group