slow query

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: slow query
Date: 2009-01-12 22:59:24
Message-ID: dcc563d10901121459s11c19e3ct804194131656f8bf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

OK, I've got a query that's running slow the first time, then fast.
But I can't see where the time is really being spend on the first run.
Query and plan attached to preserve formatting.

The index scan and nested loop that feed the next layer up nested loop
both show very short run times. Yet the nested loop they feed to
takes 30 seconds to run. If I run the query a second time, everything
looks the same but the second nested loop now runs in well under a
second.

I can't figure out where my time's going to.

Attachment Content-Type Size
bad_query.txt text/plain 3.7 KB

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Bill Preston 2009-01-12 23:03:09 Slow insert performace, 8.3 Wal related?
Previous Message Alan Hodgson 2009-01-12 20:17:47 Re: multicolumn indexes still efficient if not fully stressed?