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 04CCA9DC9E5 for ; Thu, 26 Jan 2006 12:25:18 -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 48002-04 for ; Thu, 26 Jan 2006 12:25:14 -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 2B76D9DC9C1 for ; Thu, 26 Jan 2006 12:25:13 -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 k0QGFBAn014590 for ; Thu, 26 Jan 2006 11:15:11 -0500 From: J@Planeti.Biz Message-ID: <008001c62295$156b8fc0$0d310d05@fatchubby> To: References: <786c2f6d0601260206k2201a548p48af7c7fc085d3b2@mail.gmail.com> <005d01c6228f$3772dca0$0d310d05@fatchubby> <43D8F4FD.4040703@modgraph-usa.com> Subject: Re: Query optimization with X Y JOIN Date: Thu, 26 Jan 2006 11:25:12 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit 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.588 required=5 tests=[AWL=-0.131, BIZ_TLD=1.169, NO_REAL_NAME=0.55] X-Spam-Score: 1.588 X-Spam-Level: * X-Archive-Number: 200601/441 X-Sequence-Number: 16919 If I want my database to go faster, due to X then I would think that the issue is about performance. I wasn't aware of a paticular constraint on X. I have more that a rudementary understanding of what's going on here, I was just hoping that someone could shed some light on the basic principal of this JOIN command and its syntax. Most people I ask, don't give me straight answers and what I have already read on the web is not very helpful thus far. ----- Original Message ----- From: "Craig A. James" To: Sent: Thursday, January 26, 2006 11:12 AM Subject: Re: [PERFORM] Query optimization with X Y JOIN > First, this isn't really the right place to ask -- this forum is about > performance, not SQL syntax. > > Second, this isn't a question anyone can answer in a reasonable length of > time. What you're asking for usually is taught in a class on relational > database theory, which is typically a semester or two in college. > > If you really need a crash course, dig around on the web for terms like > "SQL Tutorial". > > Good luck, > Craig > > > J@Planeti.Biz wrote: >> 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 = tableb.foreign_key AND >> tableb.pri_key = tablec.foreign_key AND... >> From what I read, it seems you can use inner/outer right/left join on >> (bla) but when I see syntax examples I see that sometimes tables are >> omitted from the 'from' section of the query and other times, no. >> Sometimes I see that the join commands are nested and others, no and >> sometimes I see joins syntax that only applies to one table. From what I >> understand join can be used to tell the database the fast way to murge >> table data together to get results by specifiying the table that has the >> primary keys and the table that has the foreign keys. >> I've read all through the postgres docs on this command and I'm still >> left lost. Can someone please explain to me in simple language how to use >> these commands or provide me with a link. I need it to live right now. >> Thanx. >> > > ---------------------------(end of broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >