X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 35AD73A4F96 for ; Fri, 7 Jan 2005 19:35:31 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 53209-10 for ; Fri, 7 Jan 2005 19:35:08 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id AB8863A4F94 for ; Fri, 7 Jan 2005 19:35:06 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j07JZ5m8028728; Fri, 7 Jan 2005 14:35:05 -0500 (EST) To: David Jaquay Cc: pgsql-performance@postgresql.org Subject: Re: Query across a date range In-reply-to: References: <20050107182106.6CBEC5AF685@svr4.postgresql.org> Comments: In-reply-to David Jaquay message dated "Fri, 07 Jan 2005 14:17:31 -0500" Date: Fri, 07 Jan 2005 14:35:04 -0500 Message-ID: <28727.1105126504@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/80 X-Sequence-Number: 9770 David Jaquay writes: > Summary: Doing a two or three table join for a date range performs > worse than doing the same query individually for each date in the > range. Could we see EXPLAIN ANALYZE, not just EXPLAIN, results? Also, have you ANALYZEd lately? If the estimated row counts are at all accurate, I doubt that forcing a nestloop indexscan would improve the situation. Also, what PG version is this? regards, tom lane