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