X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 003BB476085 for ; Mon, 5 May 2003 13:59:44 -0400 (EDT) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id 04798475EEE for ; Mon, 5 May 2003 13:59:43 -0400 (EDT) Received: from [66.219.92.2] (HELO temoku) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3009656; Mon, 05 May 2003 10:59:41 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Tom Lane Subject: Re: Suggestions wanted for 7.2.4 query Date: Mon, 5 May 2003 10:59:11 -0700 User-Agent: KMail/1.4.3 Cc: PgSQL Performance ML References: <200305031928.52906.josh@agliodbs.com> <4612.1052068989@sss.pgh.pa.us> <200305041059.41468.josh@agliodbs.com> In-Reply-To: <200305041059.41468.josh@agliodbs.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200305051059.11751.josh@agliodbs.com> X-Spam-Status: No, hits=-32.4 required=5.0 tests=BAYES_01,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_KMAIL autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/48 X-Sequence-Number: 1827 Folks, > That may be solvable without forcing a seq scan on "events", simply by=20 > overdetermining the criteria on date. That is, I can't apply the date=20 > criteria to "events" because that would require running date calucations = on=20 > each row forcing a seq scan ( i.e. (event_date + duration) between date_o= ne=20 > and date_two would require a seq scan), but I can apply a broadend versio= n=20 of=20 > the criteria to "events" ( i.e. event_date between (date_one - 1 month) a= nd=20 > (date_two + 1 day)) which would give the planner the idea that it is=20 > returning a minority of rows from "events". If anyone is interested, the above idea worked. --=20 -Josh Berkus Aglio Database Solutions San Francisco