Re: When was ANALYZE run in the past?

From: Vincent Veyron <vv(dot)lists(at)wanadoo(dot)fr>
To: Benjamin Rutt <rutt(dot)4(at)osu(dot)edu>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: When was ANALYZE run in the past?
Date: 2014-11-30 14:55:05
Message-ID: 20141130155505.60e64ad0a94b05987f831280@wanadoo.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 29 Nov 2014 15:27:07 -0500
Benjamin Rutt <rutt(dot)4(at)osu(dot)edu> wrote:

>I run autovacuum under
> a default configuration, but I suspect ANALYZE is not running frequently
> enough for my purposes (when I ran the above command on my table, it
> consistently returned 1.4 million for ~20 minutes straight; when I
> explicitly ran an ANALYZE command at that point (when I realized the
> estimate was not updating even every few minutes), the ANALYZE command took
> a few seconds, then the above command returned .7 million which matches
> what ‘select count(*)’ was returning). So I suspect ANALYZE is not running
> frequently enough or is stepping over my table for some reason.
>

Analyze is run by the autovacuum daemon, but you may be hitting the Cost-based Vacuum Delay if you deleted .7 million rows?

The documentation for postgresql 8.4 is no longer online, and things changed significantly since, so I'm not sure this applies exactly, but you can set table specific settings for the auto-vacuuming process; see :

http://www.postgresql.org/docs/current/static/routine-vacuuming.html#AUTOVACUUM

and

http://www.postgresql.org/docs/current/static/sql-createtable.html#SQL-CREATETABLE-STORAGE-PARAMETERS

--
Regards, Vincent Veyron

https://libremen.com/
Legal case, contract and insurance claim management software

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-11-30 15:03:52 Re: When was ANALYZE run in the past?
Previous Message rob stone 2014-11-30 12:38:27 Re: i386 postgres on i686 debian with multiarch