Re: Query only slow on first run

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query only slow on first run
Date: 2007-11-27 17:26:08
Message-ID: 23999.1196184368@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Andrew Sullivan <ajs(at)crankycanuck(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message cluster 2007-11-27 18:21:38 Re: Query only slow on first run
Previous Message Kevin Kempter 2007-11-27 16:57:07 Re: Query only slow on first run