Query only slow on first run

From: cluster <skrald(at)amossen(dot)dk>
To: pgsql-performance(at)postgresql(dot)org
Subject: Query only slow on first run
Date: 2007-11-27 16:33:36
Message-ID: fihgt1$1mmh$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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?

Query and output from both first and second run of Explain Analyze is
pasted here:

http://rafb.net/p/yrKyoA17.html

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Andrew Sullivan 2007-11-27 16:55:43 Re: Query only slow on first run
Previous Message Heikki Linnakangas 2007-11-27 10:12:38 Re: 8.1 planner problem ?