From: Steinar H. Gunderson <sgunderson@bigfoot.com>
To: Arkadiusz Raj <arek@raj.priv.pl>
Cc: pgsql-performance@postgresql.org
Subject: Re: index usage
Date: Mon, 23 Apr 2007 19:58:11 +0200
Message-ID: <20070423175811.GA10915@uio.no> (raw)
In-Reply-To: <20070423172018.6409A79B@post17.futuro.info.pl>
References: <20070423172018.6409A79B@post17.futuro.info.pl>
On Mon, Apr 23, 2007 at 07:20:29PM +0200, Arkadiusz Raj wrote:
> I have a table in my database that is updated every minute with new acquired
> data. Anyway there is a query to get latest values to be displayed on
> screen. I have postgresql 7.4.2 that work very fine.
You want _at least_ the latest 7.4 version -- ideally, the latest 8.2
version.
> The problem was that
> after hdd crash I have rebuild database from the archive and... Execution
> time of this query starts to be unacceptable.
Have you re-ANALYZEd after the data load?
Anyhow, the issue with the planner not knowing how to estimate expressions
like "now() - interval '5 minutes'" correctly is a known 7.4 issue, and it's
fixed in later versions. It might have worked more or less by accident
earlier, although it seems odd that it wouldn't even have considered the
index scan...
/* Steinar */
--
Homepage: http://www.sesse.net/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: sgunderson@bigfoot.com, arek@raj.priv.pl
Subject: Re: index usage
In-Reply-To: <20070423175811.GA10915@uio.no>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox