X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BC668529B7 for ; Fri, 29 Jul 2005 01:23:25 -0300 (ADT) 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 20792-01 for ; Fri, 29 Jul 2005 04:23:24 +0000 (GMT) Received: from veggie-fuel.com (veggie-fuel.com [200.46.208.238]) by svr1.postgresql.org (Postfix) with ESMTP id 75B66529B4 for ; Fri, 29 Jul 2005 01:23:23 -0300 (ADT) Received: from localhost (unknown [200.46.204.144]) by veggie-fuel.com (Postfix) with ESMTP id E2A9C35F9DE for ; Fri, 29 Jul 2005 04:23:23 +0000 (GMT) Received: from veggie-fuel.com ([200.46.208.238]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18957-03; Fri, 29 Jul 2005 04:23:21 +0000 (GMT) Received: from [10.0.0.7] (63-228-143-68.phnx.qwest.net [63.228.143.68]) by veggie-fuel.com (Postfix) with ESMTP id 46CC735F9D6; Fri, 29 Jul 2005 04:23:21 +0000 (GMT) Subject: Re: Two queries are better than one? From: Karim Nassar Reply-To: karim.nassar@acm.org To: Gnanavel S Cc: pgsql-performance@postgresql.org In-Reply-To: References: <1122591866.11860.11.camel@localhost.localdomain> Content-Type: text/plain Date: Thu, 28 Jul 2005 21:21:38 -0700 Message-Id: <1122610899.11862.63.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.029 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/458 X-Sequence-Number: 13699 On Fri, 2005-07-29 at 09:41 +0530, Gnanavel S wrote: > > Joined: > > test=> explain analyze > test-> SELECT cli_name,order.* > test-> FROM order > test-> JOIN client ON (ord_client = cli_code) > test-> WHERE ord_batch='343B' AND > ord_id='12-645'; > > where is the cli_code condition in the above query? I don't understand the question. ord_client is the client code, and cli_code is the client code, for their respective tables. batch/id is unique, so there is only one record from order, and only one client to associate. Clearer? -- Karim Nassar