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 BF485D1E13A for ; Thu, 19 Feb 2004 00:56:38 +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 63617-07 for ; Wed, 18 Feb 2004 20:56:37 -0400 (AST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 8B3C4D1E14B for ; Wed, 18 Feb 2004 20:56:34 -0400 (AST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 9D567352E2; Wed, 18 Feb 2004 16:56:22 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 9BE9135291; Wed, 18 Feb 2004 16:56:22 -0800 (PST) Date: Wed, 18 Feb 2004 16:56:22 -0800 (PST) From: Stephan Szabo To: Josh Berkus Cc: pgsql-performance Subject: Re: Forcing filter/join order? In-Reply-To: <200402181630.43503.josh@agliodbs.com> Message-ID: <20040218165410.G36125@megazone.bigpanda.com> References: <200402181610.31978.josh@agliodbs.com> <200402181630.43503.josh@agliodbs.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/214 X-Sequence-Number: 5738 On Wed, 18 Feb 2004, Josh Berkus wrote: > The planner can't, or doesn't want to, use an index on (event_date, > (event_date + duration)) where the first column is an ascending sort and the > second a descending sort. So I've coded a workaround that's quite > inelegant but does get the correct results in 0.3 seconds (as opposed to the > 2.2 seconds taken by the example plan). Can you give more information? I know that I'm not exactly certain what the situation is from the above and the original query/explain piece.