Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id CE7C19FB308 for ; Thu, 5 Oct 2006 13:35:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 09610-05 for ; Thu, 5 Oct 2006 13:35:35 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id E01869FB2FD for ; Thu, 5 Oct 2006 13:35:34 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k95GZYn7021473; Thu, 5 Oct 2006 12:35:34 -0400 (EDT) To: "Carlo Stonebanks" cc: pgsql-performance@postgresql.org Subject: Re: Performance Optimization for Dummies 2 - the SQL In-reply-to: References: <12239.1160054675@sss.pgh.pa.us> Comments: In-reply-to "Carlo Stonebanks" message dated "Thu, 05 Oct 2006 12:29:42 -0400" Date: Thu, 05 Oct 2006 12:35:33 -0400 Message-ID: <21472.1160066133@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.092 tagged_above=0 required=5 tests=AWL, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/128 X-Sequence-Number: 21257 "Carlo Stonebanks" writes: > Just to clarify: if I expect to join two tables that I expect to benfit from > indexed scans, I should create indexes on the joined columns on BOTH sides? Well, it all depends on the queries you plan to issue ... but for the particular query shown here, the lack of that index is the performance bottleneck. regards, tom lane