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 149AED1E0FF for ; Thu, 19 Feb 2004 17:40:06 +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 48079-06 for ; Thu, 19 Feb 2004 13:40:03 -0400 (AST) Received: from davinci.ethosmedia.com (server228.ethosmedia.com [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id EF433D1E0CD for ; Thu, 19 Feb 2004 13:40:01 -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 4457211; Thu, 19 Feb 2004 09:41:08 -0800 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Tom Lane Subject: Re: Forcing filter/join order? Date: Thu, 19 Feb 2004 09:39:12 -0800 User-Agent: KMail/1.5.4 Cc: Stephan Szabo , pgsql-performance References: <200402181610.31978.josh@agliodbs.com> <200402182049.49111.josh@agliodbs.com> <28948.1077167299@sss.pgh.pa.us> In-Reply-To: <28948.1077167299@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402190939.12479.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/226 X-Sequence-Number: 5750 Tom, > Uh, why do you need the child table? Because there's linked information which needs to be kept by day for multi-day events. Also, it makes calendar reports easier, where one wants each day of a multi-day event to appear on each day of the calendar. >Seems like the correct incantation > given an assumption about maximum duration is > > event_date <= 'end-date' AND (event_date + duration) >= 'start-date' > AND event_date >= 'start-date' - 'max-duration' Hmmmm ... so the same as what I have, only with the extra condition for event_date+duration and without the IN clause. I'll try it, thanks! -- -Josh Berkus Aglio Database Solutions San Francisco