Bug #474: Index using problem

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема Bug #474: Index using problem
Дата
Msg-id 200110050721.f957L1i27238@postgresql.org
обсуждение исходный текст
Ответы Re: Bug #474: Index using problem
Re: Bug #474: Index using problem
Список pgsql-bugs
JoE Olcsak (joe78@freemail.hu) reports a bug with a severity of 4
The lower the number the more severe it is.

Short Description
Index using problem

Long Description
I have a problem when using indexes under PostgreSQL 7.1.1 ...

The problem is :

  I have a field of table ... This is an INT4 type field ... and I
  created an index for this field like :
        create index idx_of_field on cim(utod_cim_id);
  ... and I executed a simple query ...

  explain select * from cim where utod_cim_id=0;

  NOTICE:  QUERY PLAN:

  Seq Scan on cim  (cost=0.00..6555.41 rows=253633 width=118)

  EXPLAIN

  The query optimizer does not use my index..

  I'm executed vacuum analyze command for this table but this not   helps me ...

  Then I created another index for this field:

  create index idx_of_field2 on cim(int4(utod_cim_id));

  ... and I executed another simple query :

   explain select * from cim where int4(utod_cim_id)=0;
   NOTICE:  QUERY PLAN:

   Index Scan using idx_of_field2 on cim  (cost=0.00..6499.70    rows=2536 width=118)

   EXPLAIN

What is wrong in the first case ?



Sample Code


No file was uploaded with this report

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Long options for psql in 7.1.3
Следующее
От: Andreas Wernitznig
Дата:
Сообщение: Re: Bug #474: Index using problem