X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 465E5D1E0CD for ; Thu, 19 Feb 2004 00:32:40 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 62047-03 for ; Wed, 18 Feb 2004 20:32:42 -0400 (AST) Received: from davinci.ethosmedia.com (server228.ethosmedia.com [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 9B3F9D1E0C7 for ; Wed, 18 Feb 2004 20:32:38 -0400 (AST) Received: from [63.195.55.98] (HELO 192.168.1.29) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 4453535; Wed, 18 Feb 2004 16:33:50 -0800 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: "Peter Darley" , "pgsql-performance" Subject: Re: Forcing filter/join order? Date: Wed, 18 Feb 2004 16:31:54 -0800 User-Agent: KMail/1.5.4 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402181631.54175.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/213 X-Sequence-Number: 5737 Peter, > I'm sure the big brains have a better suggestion, but in the mean time > could you do something as simple as: > > SELECT * > FROM (select * from events where event_date BETWEEN 'date1' AND 'date2') e > LEFT OUTER JOIN cases ON e.case_id = cases.case_id; Thanks, but that doens't work; the planner will collapse the subquery into the main query, which most of the time is the right thing to do. -- -Josh Berkus Aglio Database Solutions San Francisco