X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E53ED5678A for ; Mon, 21 Mar 2005 08:29:54 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 01553-02 for ; Mon, 21 Mar 2005 08:29:52 +0000 (GMT) Received: from mail.ccl.ru (mail.ccl.ru [195.222.130.78]) by svr1.postgresql.org (Postfix) with ESMTP id 3976C5660D for ; Mon, 21 Mar 2005 08:29:51 +0000 (GMT) Received: from s02.mz.intra (mail.mz.perm.ru [195.222.139.86]) by mail.ccl.ru (8.13.1/8.13.1) with ESMTP id j2L8TJTZ017455 for ; Mon, 21 Mar 2005 13:29:50 +0500 (YEKT) Received: from server1c ([192.168.22.73]) by s02.mz.intra with Microsoft SMTPSVC(6.0.3790.211); Mon, 21 Mar 2005 13:30:59 +0500 Date: Mon, 21 Mar 2005 13:26:21 +0500 From: Mihail Nasedkin X-Mailer: The Bat! (v2.00) CD5BF9353B3B7091 Reply-To: Mihail Nasedkin X-Priority: 3 (Normal) Message-ID: <10520036015.20050321132621@mail.ru> To: pgsql-sql@postgresql.org Subject: index scan MIME-Version: 1.0 Content-Type: text/plain; charset=Windows-1251 Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 21 Mar 2005 08:30:59.0286 (UTC) FILETIME=[4F208760:01C52DF0] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.452 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, HOT_NASTY X-Spam-Level: X-Archive-Number: 200503/277 X-Sequence-Number: 20756 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