Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 67050B5DC58 for ; Tue, 2 Aug 2011 21:16:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 55063-01-4 for ; Wed, 3 Aug 2011 00:16:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm25-vm3.bullet.mail.ne1.yahoo.com (nm25-vm3.bullet.mail.ne1.yahoo.com [98.138.91.155]) by mail.postgresql.org (Postfix) with SMTP id D5414B5DE98 for ; Tue, 2 Aug 2011 21:16:27 -0300 (ADT) Received: from [98.138.90.52] by nm25.bullet.mail.ne1.yahoo.com with NNFMP; 03 Aug 2011 00:16:27 -0000 Received: from [98.138.89.199] by tm5.bullet.mail.ne1.yahoo.com with NNFMP; 03 Aug 2011 00:16:26 -0000 Received: from [127.0.0.1] by omp1057.mail.ne1.yahoo.com with NNFMP; 03 Aug 2011 00:16:26 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 967249.80881.bm@omp1057.mail.ne1.yahoo.com Received: (qmail 30783 invoked by uid 60001); 3 Aug 2011 00:16:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1312330586; bh=uNQ2pz38mpscpAVbPuRRNT3y1G26LYiwwdoEbuGPFoM=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=L6V3EsKbFDvGrDN/LkqJuJ3E+THD0AMe4aJddNP46bD7JKcyIA5RF3Z0pi3XhqFW9KFdOyKPFaUffznaAF4P2WUjgsw39FHZThgf72to91l4YBSR6HF8KEKbNOuc4ricuBJbGCQXCIvmC7hbnKQzGzk5sDWK1mjIIL8UWqaokF8= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=JvT7AQTwlTt+Clw30/mkK4rFOiHoqBbzWHU9vM37gdVESy4ShTJtsWWwB8IfGMHCrNrBBs6rVbRq6xPJwLxUmOg0uDNoeqoFQODqRoEeILnYsXEOAoD27RVyHH3SxgNJ62YCwvTcwy3ZF9pxU++/FjDZ26aPAJfK2SONSlzxzR0=; X-YMail-OSG: h9os3r0VM1kATiq4_e45zHptkHPxnooTfUJAzFh8360Yolr I99JnsAyK.XLdGvB1oVlJlqxI5r3DTKHPRLkAVBdxPZGm9d0_yxCyMeV0E_8 ZaCu_WyqZFCdzOiAENG.fo1a3pNkwkjaUxkQDhQ7pZTPaFnKRCZeHNyLp49J I_Tc4mse7ZNeAVe8J9qRtndDRdLjWt3mLmvTydljJRzFsxTzeVCTTMLVouMU ghCOyQpHbPauwhkRjg3RimQ8v5O4gpsckdbh99lAJk24Xzham3IQEy5gZ.B9 tRCJIxAWDmA1B9eeYa0IwCnesnzQAgJql19q5E6MiWAqBoGgVlj8tyY52gTd AAv7CYL0GpGHQfGI47nlMLubvgJK_xD4xJzm_rDUJmWMORrenoyqg4lVvSJI P_QGWr6Iw3VzrnJLbZYV27mHC3DS9H.5Fi3Za94UjxbrzhuBzZC8B Received: from [67.170.234.149] by web121710.mail.ne1.yahoo.com via HTTP; Tue, 02 Aug 2011 17:16:26 PDT X-Mailer: YahooMailWebService/0.8.112.310352 References: <4E379C43.7020805@orkash.com> Message-ID: <1312330586.28870.YahooMailNeo@web121710.mail.ne1.yahoo.com> Date: Tue, 2 Aug 2011 17:16:26 -0700 (PDT) From: lars hofhansl Reply-To: lars hofhansl Subject: Re: Which Join is better To: Adarsh Sharma , "pgsql-performance@postgresql.org" In-Reply-To: <4E379C43.7020805@orkash.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.705 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.806 X-Spam-Level: X-Archive-Number: 201108/30 X-Sequence-Number: 44477 Unless you use the explicit join syntax:=0A=0A=0Aselect p.* from A p join B= q on (p.id =3D q.id)=0A=0Aand also set=A0=A0join_collapse_limit=3D 1=0AThe= order of the joins is determined by the planner.=0A=0A=0AAlso explain is y= our friend :)=0A=0A________________________________=0AFrom: Adarsh Sharma <= adarsh.sharma@orkash.com>=0ATo: pgsql-performance@postgresql.org=0ASent: Mo= nday, August 1, 2011 11:42 PM=0ASubject: [PERFORM] Which Join is better=0A= =0ADear all,=0A=0AJust want to know which join is better for querying data = faster.=0A=0AI have 2 tables A ( 70 GB ) & B ( 7 MB )=0A=0AA has 10 columns= & B has 3 columns.Indexes exist on both tables's ids.=0A=0Aselect p.* from= table A p, B q where p.id=3Dq.id=0A=0Aor=0A=0Aselect p.* from table B q , = A p where q.id=3Dp.id=0A=0A=0AThanks=0A=0A-- Sent via pgsql-performance mai= ling list (pgsql-performance@postgresql.org)=0ATo make changes to your subs= cription:=0Ahttp://www.postgresql.org/mailpref/pgsql-performance