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 21ED156456 for ; Mon, 21 Mar 2005 10:46:22 +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 39439-02 for ; Mon, 21 Mar 2005 10:46:20 +0000 (GMT) Received: from mail.ccl.ru (mail.ccl.ru [195.222.130.78]) by svr1.postgresql.org (Postfix) with ESMTP id 865575644B for ; Mon, 21 Mar 2005 10:46:18 +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 j2LAj22Y031329 for ; Mon, 21 Mar 2005 15:45:13 +0500 (YEKT) Received: from server1c ([192.168.22.73]) by s02.mz.intra with Microsoft SMTPSVC(6.0.3790.211); Mon, 21 Mar 2005 15:09:53 +0500 Date: Mon, 21 Mar 2005 15:05:15 +0500 From: Mihail Nasedkin X-Mailer: The Bat! (v2.00) CD5BF9353B3B7091 Reply-To: Mihail Nasedkin X-Priority: 3 (Normal) Message-ID: <12925969953.20050321150515@mail.ru> To: pgsql-sql@postgresql.org Subject: Re: index scan In-Reply-To: <423E90BC.80501@archonet.com> References: <10520036015.20050321132621@mail.ru> <423E90BC.80501@archonet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 21 Mar 2005 10:09:53.0214 (UTC) FILETIME=[200615E0:01C52DFE] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.17 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/280 X-Sequence-Number: 20759 Die, Richard. Thank you for answer March, 21 2005 14:15:40: RH> Mihail Nasedkin wrote: >> 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=...) RH> You've commented out the interesting bits (the costs/rows) In that example main point - Seq Scan on site_screens >> I want to Index Scan. What must I do? RH> Why do you want an index scan? Do you have any evidence it will be RH> faster than a sequential scan? No, but I want to be ready for make Index scan queries in future. I make first steps on the customize SQL. Where I can read more about optimize the SQL-queries and about differences between types of scan? -- Regards, Mihail Nasedkin m.nasedkin.perm@mail.ru