X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 16E07D1E8AE for ; Thu, 22 Jan 2004 20:44:24 +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 97148-08 for ; Thu, 22 Jan 2004 16:43:54 -0400 (AST) Received: from davinci.ethosmedia.com (server228.ethosmedia.com [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id F0027D1E8BA for ; Thu, 22 Jan 2004 16:43:51 -0400 (AST) Received: by davinci.ethosmedia.com (CommuniGate Pro PIPE 4.0.2) with PIPE id 4299204; Thu, 22 Jan 2004 12:44:52 -0800 Received: from [63.195.55.98] (HELO 192.168.1.29) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 4299208; Thu, 22 Jan 2004 12:44:48 -0800 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: "Shea,Dan [CIS]" , "'josh@agliodbs.com'" , pgsql-performance@postgresql.org Subject: Re: database performance and query performance question Date: Thu, 22 Jan 2004 12:43:15 -0800 User-Agent: KMail/1.5.4 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200401221243.15312.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/226 X-Sequence-Number: 5400 Dan, > Something that I do not understand is why if you use a valid_time = > '2004-01-22 00:00:00' the query will use the index but if you do a > valid_time > '2004-01-22 00:00:00' it does not use the index? Because of the expected number of rows to be returned. Take a look at the row estimates on the forecastleelement scans. You can improve these estimates by increasing the ANALYZE stats and/or running ANALYZE more often. Of course, increasing the stats makes analyze run slower ... -- -Josh Berkus Aglio Database Solutions San Francisco