Need help on index!!!

Поиск
Список
Период
Сортировка
От Johnson Ma
Тема Need help on index!!!
Дата
Msg-id 3D13C4AE.B93E1EAB@qcominc.com
обсуждение исходный текст
Ответы Re: Need help on index!!!  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: Need help on index!!!  (Dan Weston <ddweston@cinesite.com>)
Re: Need help on index!!!  (Saito Yasuhiro <yassaito@jcom.home.ne.jp>)
Список pgsql-general
Hi guru

I have a table with 300,000 records. I also created a index on it. But
the postgresql use sequence scan every time, when i search one record.
It is so slow. why?

here is create table script
create table pmmeasure (dataid bigint not null,
                     measurenum bigint DEFAULT nextval('measurenum')
UNIQUE NOT NULL,
                     name  varchar(100) not null,
                     value varchar(100) not null,
                     constraint pk_pmmeasure primary key (measurenum),
                     constraint fk_pmmeasure_1 foreign key (dataid)
references pmdata (dataid)
 );
create index index_pm on pmmeasure (dataid);


When I do like
explain analyze select * from pmmeasure where dataid = 10000;

it shows that postgresql always sequence scan for that record.


Thanks a lot.


Johnson








В списке pgsql-general по дате отправления:

Предыдущее
От: janusz@subtilia.net (Janusz Guzdzik)
Дата:
Сообщение: Locale settings
Следующее
От: "Bruno Baguette"
Дата:
Сообщение: Unable to run one pl/pgSQL function :-(