Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAE0JDm59133 for ; Tue, 13 Nov 2001 19:19:13 -0500 (EST) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.7) with HTTP id 505462; Tue, 13 Nov 2001 16:19:13 -0800 From: "Josh Berkus" Subject: Re: Optimization with dates To: Jean-Christophe Boggio , pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.7 Date: Tue, 13 Nov 2001 16:19:13 -0800 Message-ID: In-Reply-To: <72319017913.20011114005656@thefreecat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200111/178 X-Sequence-Number: 5562 Jean-Christophe, > Aggregate (cost=256546.78..256546.78 rows=1 width=0) > -> Seq Scan on gains (cost=0.00..250627.68 rows=2367640 width=0) > > whereas : Hmmm... if the number of rows is actually accurate (2M out of 10M in the last 30 days) then a Seq Scan seems like a good plan to me. If the numbers aren't accurate, it's time to run a VACUUM ANALYZE. Regardless, if you're actually querying for 2M recordsets, you'd better throw some hardware at the problem, and learn the .conf parameters. -Josh ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco