index scan - Mailing list pgsql-sql

From Mihail Nasedkin
Subject index scan
Date
Msg-id 10520036015.20050321132621@mail.ru
Whole thread Raw
Responses Re: index scan  (Richard Huxton <dev@archonet.com>)
List pgsql-sql
Hello, pgsql-sql.

I have customize simple query with join two tables:

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

xxxx=# \d site_screens
-------------+------------------------+--------------id_site     | oid                    | not nullscreen_name |
charactervarying(255) | not nullscreen_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
---------------------------------------------------------------------------HashJoin  (cost=...)  Hash Cond:
("outer".id_site= "inner".oid)  ->  Seq Scan on site_screens ss  (cost=...)  ->  Hash  (cost=...)        ->  Seq Scan
onsites s  (cost=...)
 

I want to Index Scan. What must I do?

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



pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: date subtraction
Next
From: Richard Huxton
Date:
Subject: Re: index scan