Re: Initial queries of day slow

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Initial queries of day slow
Date: 2014-04-07 11:14:58
Message-ID: 20140407111457.GE60402@crankycanuck.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Apr 07, 2014 at 10:32:59AM +0100, Rebecca Clarke wrote:

> normally execute promptly, are taking a long time when they are executed
> first thing in the morning (after the database has been inactive for
> several hours). After the first execution, everything is back to normal.

Just guessing, but perhaps because your system's disk buffers have all
been blown away, so things that are normally in memory aren't any
more. In particular,

> A while back I turned autovacuum off and now instead I run a daily cron at
> 3am that executes a script which does a VACUUM ANALYZE on each table.

this goes through every table in the database, and probably not in the
order such that the most-frequently-used tables are last in the set.
But also, why did you turn off autovacuum? In the earliest
implementations of autovacuum that was sometimes worth doing for very
specific workloads, but in more recent releases (9.1.x certainly
qualifies) you are much better to tune autovacuum.

Best regards,

A

--
Andrew Sullivan
ajs(at)crankycanuck(dot)ca

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2014-04-07 12:20:22 Re: Order By and Comparisson
Previous Message howardnews@selestial.com 2014-04-07 11:11:21 Re: Order By and Comparisson