index scan

From: Mihail Nasedkin <m(dot)nasedkin(dot)perm(at)mail(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: index scan
Date: 2005-03-21 08:26:21
Message-ID: 10520036015.20050321132621@mail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(dot)nasedkin(dot)perm(at)mail(dot)ru

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2005-03-21 09:15:40 Re: index scan
Previous Message Richard Huxton 2005-03-21 08:07:18 Re: date subtraction