X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 73FDD9DC811 for ; Thu, 26 Jan 2006 11:43:16 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 23436-02 for ; Thu, 26 Jan 2006 11:43:20 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from bob.planeti.biz (unknown [66.98.130.45]) by postgresql.org (Postfix) with ESMTP id 374FB9DC800 for ; Thu, 26 Jan 2006 11:43:12 -0400 (AST) Received: from fatchubby (cpe-071-070-134-248.nc.res.rr.com [71.70.134.248]) by bob.planeti.biz (8.12.10/8.12.5) with SMTP id k0QFXBAn012852 for ; Thu, 26 Jan 2006 10:33:11 -0500 From: J@Planeti.Biz Message-ID: <005d01c6228f$3772dca0$0d310d05@fatchubby> To: References: <786c2f6d0601260206k2201a548p48af7c7fc085d3b2@mail.gmail.com> Subject: Query optimization with X Y JOIN Date: Thu, 26 Jan 2006 10:43:12 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_005A_01C62265.4E685720" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.06 required=5 tests=[AWL=0.509, HTML_MESSAGE=0.001, NO_REAL_NAME=0.55] X-Spam-Score: 1.06 X-Spam-Level: * X-Archive-Number: 200601/438 X-Sequence-Number: 16916 This is a multi-part message in MIME format. ------=_NextPart_000_005A_01C62265.4E685720 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hey guys, how u been. This is quite a newbie question, but I need to ask = it. I'm trying to wrap my mind around the syntax of join and why and = when to use it. I understand the concept of making a query go faster by = creating indexes, but it seems that when I want data from multiple = tables that link together the query goes slow. The slow is typically due = to expensive nested loops. The reason is, all my brain understands is: select tablea.data tableb.data tablec.data from tablea tableb tablec where tablea.pri_key =3D tableb.foreign_key AND tableb.pri_key =3D tablec.foreign_key AND...