From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-performance@postgresql.org
Subject: Re: Query only slow on first run
Date: Tue, 27 Nov 2007 11:55:43 -0500
Message-ID: <20071127165543.GY11978@crankycanuck.ca> (raw)
In-Reply-To: <fihgt1$1mmh$1@news.hub.org>
References: <fihgt1$1mmh$1@news.hub.org>
On Tue, Nov 27, 2007 at 05:33:36PM +0100, cluster wrote:
> I have a query that takes about 7000 ms in average to complete the first
> time it runs. Subsequent runs complete in only 50 ms. That is more than
> a factor 100 faster! How can I make the query perform good in the first
> run too?
Probably by buying much faster disk hardware. You'll note that the query
plans you posted are the same, except for the actual time it took to get the
results back. That tells me you have slow storage. On subsequent runs,
the data is cached, so it's fast.
A
--
Andrew Sullivan
Old sigs will return after re-constitution of blue smoke
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: ajs@crankycanuck.ca
Subject: Re: Query only slow on first run
In-Reply-To: <20071127165543.GY11978@crankycanuck.ca>
* 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