Why my index does not increase performance?

Поиск
Список
Период
Сортировка
От Yuri Kulaghin
Тема Why my index does not increase performance?
Дата
Msg-id Pine.LNX.3.93.981014110053.8404A-100000@libra1.west-call.com
обсуждение исходный текст
Ответы Re: [ADMIN] Why my index does not increase performance?  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Daniele Orlandi
Дата:
Сообщение: Re: [ADMIN] COPY slows down; is it normal?
Следующее
От: "Gilley, Charles H."
Дата:
Сообщение: re: binary/build woes, procedural question