pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Najm Hashmi <najm@mondo-live.com>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Index scan
Date: Thu, 01 Feb 2001 12:02:36 -0500
Message-ID: <3A7996AC.AD99A45B@mondo-live.com> (raw)

Hi all,
 I  am unable to understand why  my inidcies are not  used in the query.
I have following indices:
index on categories.root
index on media.category
unique index on categories.id
 Here is my query :
mondo=# explain select m.id
                   form media m, categories c
                    where c.id=m.category and c.root like 'B%';
NOTICE:  QUERY PLAN:

Hash Join  (cost=22.55..116.80 rows=11 width=28)
  ->  Seq Scan on media m  (cost=0.00..60.40 rows=840 width=16)
  ->  Hash  (cost=22.50..22.50 rows=20 width=12)
        ->  Index Scan using cat_id_root on categories c
(cost=0.00..22.50 rows=20 width=12)
EXPLAIN

 I simply dont understand why it uses seq scan on media.
Thanks all for your help.
-Najm




view thread (6+ messages)  latest in thread

Message-ID: <3A7996AC.AD99A45B@mondo-live.com>
Permalink:  ../3A7996AC.AD99A45B@mondo-live.com/
Also on:    postgresql.org/message-id/3A7996AC.AD99A45B@mondo-live.com

 · 

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: najm@mondo-live.com
  Subject: Re: Index scan
  In-Reply-To: <3A7996AC.AD99A45B@mondo-live.com>

* 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