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

index is not used

From: mila boldareva <pierro(at)dds(dot)nl>
To: pgsql-novice(at)postgresql(dot)org
Subject: index is not used
Date: 2002-08-20 11:17:33
Message-ID: 13389921169.20020820131733@dds.nl (view raw or flat)
Thread:
Lists: pgsql-novice
Hello,
i need help for my strange problem.

I have a table of ~ 9 000 000 rows,

      Table "mytable"
  Column  |  Type   | Modifiers 
----------+---------+-----------
 field1   | integer | not null
 field2   | integer | not null
 field3   | real    |
Indexes: mytable_field1_key,
         mytable_field3_key
Primary key: mytable_field1_field2_pkey

But the indices are not used, even when I added a separate index on
field1 !

  trc=# explain select *  from mytable where field1 = 6;
  NOTICE:  QUERY PLAN:

  Seq Scan on mytable  (cost=0.00..182382.74 rows=49579 width=4)

  EXPLAIN

OR:

  trc=# explain select * from mytable where field3 = 0.3;
  NOTICE:  QUERY PLAN:

  Seq Scan on mytable  (cost=0.00..182382.74 rows=49579 width=4)

  EXPLAIN

I am using postgres 7.2.1 on RedHat.

On the same installation in another database similar table of 100 rows
uses  the indices when needed.

thanks in advance,
mila.


Responses

pgsql-novice by date

Next:From: Darrin DomoneyDate: 2002-08-20 13:15:48
Subject: Event recurrence - in database or in application code ????
Previous:From: Josh BerkusDate: 2002-08-20 03:29:10
Subject: Part 2 of Joy of Index up

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