pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ahti Legonkov <lego@127.0.0.1>
To: pgsql-sql@postgresql.org
Subject: Why doesn't it use indexes?
Date: Tue, 02 Jul 2002 18:46:59 +0300
Message-ID: <3D21CAF3.8090508@127.0.0.1> (raw)

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






view thread (3+ messages)  latest in thread

Message-ID: <3D21CAF3.8090508@127.0.0.1>
Permalink:  ../3D21CAF3.8090508@127.0.0.1/
Also on:    postgresql.org/message-id/3D21CAF3.8090508@127.0.0.1

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lego@127.0.0.1
  Subject: Re: Why doesn't it use indexes?
  In-Reply-To: <3D21CAF3.8090508@127.0.0.1>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox