pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mihail Nasedkin <m.nasedkin.perm@mail.ru>
To: pgsql-sql@postgresql.org
Subject: index scan
Date: Mon, 21 Mar 2005 13:26:21 +0500
Message-ID: <10520036015.20050321132621@mail.ru> (raw)

Hello, pgsql-sql.

I have customize simple query with join two tables:

xxxx=# \d sites                                                                                   Таблица "public.sites"                                         Колонка |          Тип           |     Модификаторы
---------+------------------------+-----------------------
 name    | character varying(255) | not null
 rem     | text                   |
 enabled | boolean                | not null default true
Index:
      "pk_sites" primary key, btree (oid)

xxxx=# \d site_screens
-------------+------------------------+--------------
 id_site     | oid                    | not null
 screen_name | character varying(255) | not null
 screen_code | text                   |
Foreign keys:
    "$1" FOREIGN KEY (id_site) REFERENCES sites(oid)

xxxx=# explain select * from sites s join site_screens ss on s.oid = ss.id_site;                                QUERY PLAN                                      ---------------------------------------------------------------------------
 Hash Join  (cost=...)
   Hash Cond: ("outer".id_site = "inner".oid)
   ->  Seq Scan on site_screens ss  (cost=...)
   ->  Hash  (cost=...)
         ->  Seq Scan on sites s  (cost=...)

I want to Index Scan. What must I do?

-- 
Regards,
 Mihail Nasedkin
 mailto:m.nasedkin.perm@mail.ru




view thread (6+ messages)  latest in thread

Message-ID: <10520036015.20050321132621@mail.ru>
Permalink:  ../10520036015.20050321132621@mail.ru/
Also on:    postgresql.org/message-id/10520036015.20050321132621@mail.ru

 · 

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: m.nasedkin.perm@mail.ru
  Subject: Re: index scan
  In-Reply-To: <10520036015.20050321132621@mail.ru>

* 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