Re: Index not used ! Why? + Little graphical client ...
От | Nicolas Verger |
---|---|
Тема | Re: Index not used ! Why? + Little graphical client ... |
Дата | |
Msg-id | OBEKKEAKKLKKGIEBIPICIEDPCBAA.nicolas@verger.net обсуждение исходный текст |
Ответ на | Index not used ! Why? ("Gabor Csuri" <gcsuri@auto999.com>) |
Список | pgsql-hackers |
> my database server has very high load in this morning. > I've found the problem. One of my index was not used so far! > it's interesting: > ... > addb=> CREATE INDEX banners_b_no_key ON banners (b_no); > CREATE > addb=> EXPLAIN SELECT b_link FROM banners WHERE b_no = 3; > NOTICE: QUERY PLAN: > > Index Scan using banners_b_no_key on banners (cost=0.00..4.43 > rows=1 width=12) > > EXPLAIN > addb=> > > Why index wasn't used ? > postgresql-7.1.2, redhat 7.0, kernel:2.2.19 Try to create a unique index : CREATE UNIQUE INDEX banners_b_no_key ON banners (b_no); or specify a primary key : ALTER TABLE banners ADD CONSTRAINT pk_banners PRIMARY KEY (b_no); then ANALYZE your table .... -- Nicolas -- We ( me and my teammate ) try to create a little graphical client for PostgreSQL in Java. If someone want to try it : http://pgInhaler.ifrance.com. It's an alpha version with lots of bugs... Try it and send us your feedback to pginhaler@ifrance.com... Thanx...
В списке pgsql-hackers по дате отправления: