Query only slow on first run - Mailing list pgsql-performance

From cluster
Subject Query only slow on first run
Date
Msg-id fihgt1$1mmh$1@news.hub.org
Whole thread Raw
Responses Re: Query only slow on first run  (Andrew Sullivan <ajs@crankycanuck.ca>)
Re: Query only slow on first run  (Kevin Kempter <kevin@kevinkempterllc.com>)
List 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

pgsql-performance by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: 8.1 planner problem ?
Next
From: Andrew Sullivan
Date:
Subject: Re: Query only slow on first run