pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-performance@postgresql.org
Subject: Re: Query only slow on first run
Date: Tue, 27 Nov 2007 12:26:08 -0500
Message-ID: <23999.1196184368@sss.pgh.pa.us> (raw)
In-Reply-To: <20071127165543.GY11978@crankycanuck.ca>
References: <fihgt1$1mmh$1@news.hub.org>
	<20071127165543.GY11978@crankycanuck.ca>

Andrew Sullivan <ajs@crankycanuck.ca> writes:
> 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.

Or buy more RAM, so that the data can stay cached.

			regards, tom lane



view thread (24+ messages)  latest in thread

Message-ID: <23999.1196184368@sss.pgh.pa.us>
Permalink:  ../23999.1196184368@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23999.1196184368@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us
  Subject: Re: Query only slow on first run
  In-Reply-To: <23999.1196184368@sss.pgh.pa.us>

* 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