Why doesn't it use indexes?

From: Ahti Legonkov <lego(at)127(dot)0(dot)0(dot)1>
To: pgsql-sql(at)postgresql(dot)org
Subject: Why doesn't it use indexes?
Date: 2002-07-02 15:46:59
Message-ID: 3D21CAF3.8090508@127.0.0.1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I have this query:
select * from reo inner join usr on reo.owner_id=usr.user_id

I also have created these indexes:
CREATE INDEX "owner_id_reo_key" ON reo (owner_id);
CREATE INDEX "user_id_user_key" ON usr (user_id);

Explain tells me this:
Merge Join (cost=1341.74..1481.12 rows=299697 width=461)
-> Sort (cost=775.05..775.05 rows=6629 width=328)
-> Seq Scan on apartment_reo reo (cost=0.00..354.29 rows=6629
width=328)
-> Sort (cost=566.69..566.69 rows=4521 width=133)
-> Seq Scan on USER usr (cost=0.00..292.21 rows=4521 width=133)

Why it does not use indexes I have created?

--
Ahti Legonkov

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ricardo Javier Aranibar León 2002-07-02 20:07:37 constraint
Previous Message Nick Riemondi 2002-07-02 14:30:19 Re: CASE Select, referring to selected value