Re: VACUUM ANALYZE downgrades performance

From: Shridhar Daithankar <ghodechhap(at)ghodechhap(dot)net>
To: Dmitry Karasik <dmitry(at)karasik(dot)eu(dot)org>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: VACUUM ANALYZE downgrades performance
Date: 2004-12-02 16:38:57
Message-ID: 200412022208.57760.ghodechhap@ghodechhap.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thursday 02 Dec 2004 9:37 pm, Dmitry Karasik wrote:
> Hi Thomas!
>
> Thomas> Look at the ACTUAL TIME. It dropped from 0.029ms (using the index
> Thomas> scan) to 0.009ms (using a sequential scan.)
>
> Thomas> Index scans are not always faster, and the planner/optimizer knows
> Thomas> this. VACUUM ANALYZE is best run when a large proportion of data
> Thomas> has been updated/loaded or in the off hours to refresh the
> Thomas> statistics on large datasets.
>
> While I agree that generally this is true, look how stupid this
> behavior looks in this particular case: A developer creates a table
> and index, knowing that the table will be large and will be intensively
> used. An admin runs 'VACUUM ANALYZE' when table is occasionally empty,
> and next, say, 1 day, until another 'VACUUM ANALYZE' starts, the index
> is simply not used! Sure you don't suppose to run 'VACUUM ANALYZE' every
> 5 minutes as a solution, right?

Why not? If the updates are frequent enough, that is *the* solution.

But you could always use autovacuum daemon in most case.

HTH

Shridhar

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Thomas F.O'Connell 2004-12-02 16:47:22 Re: Alternatives to Dell?
Previous Message Steinar H. Gunderson 2004-12-02 16:30:44 Re: VACUUM ANALYZE downgrades performance