Received: from nexus.kearneydev.com (IDENT:root@[208.136.214.2]) by hub.org (8.9.3/8.9.3) with ESMTP id KAA82715 for ; Mon, 19 Jul 1999 10:04:19 -0400 (EDT) (envelope-from secret@kearneydev.com) Received: from kearneydev.com (atu.kearneydev.com [208.136.214.93]) by nexus.kearneydev.com (8.8.5/8.8.5) with ESMTP id KAA16000; Mon, 19 Jul 1999 10:02:58 -0400 Message-ID: <37933011.CB0F3E76@kearneydev.com> Date: Mon, 19 Jul 1999 10:02:57 -0400 From: secret Organization: Kearney Development Co., Inc. X-Mailer: Mozilla 4.51 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: Tom Lane CC: PG-SQL , John Ridout Subject: Re: [SQL] Good Optimization References: <26200.931362157@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Tom Lane wrote: > secret writes: > > There is a simple way to optimize SQL queries involving joins to > > PostgreSQL that I think should be handled by Postgre? If one is joining > > a tables a,b on attribute "x" and if one has something like x=3 then it > > helps A LOT to say: a.x=3 and b.x=3 in addition to saying a.x=b.x ... > > The example below shoulds the radical speed gain of doing this, and I > > think it isn't something real obvious to most people... > > How much *actual* speedup is there? I don't trust the optimizer's > numbers as anything more than relative measures ;-) > > I'm a bit surprised that you are getting a nested-loop plan and not > a merge or hash join. With a merge join, at least, there ought not be > a large difference from providing the additional qual clause (I think). > What Postgres version are you using? > > regards, tom lane The actual performance difference is HUGE. Hours vs minutes or Minutes vs Seconds... David Secret MIS Director Kearney Development Co., Inc.