Re: Autovacuum and Autoanalyze

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Simon Riggs <simon(at)2ndQuadrant(dot)com>, David Fetter <david(at)fetter(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Autovacuum and Autoanalyze
Date: 2008-09-17 14:52:20
Message-ID: 13358.1221663140@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> Alvaro Herrera wrote:
>> Why doesn't this new request conflict with that one?

> The problem back then was that a CREATE INDEX was waiting on the
> autoanalyze to finish, and the autoanalyze took a long time to finish
> because of vacuum_cost_delay. Now that we have the auto-cancel
> mechanism, that's not a problem.

Define "not a problem". With auto-cancel, what will happen is that
whatever work the autoanalyze does will be wasted. It seems to me
that the current complaint is about background autovacuum/autoanalyze
wasting cycles during a bulk load, and there's certainly no purer waste
than an analyze cycle that gets aborted.

I tend to agree with Alvaro that there's not very much of a use case for
an analyze-only autovacuum mode. Assuming that we get to the point of
having a parallelizing pg_restore, it would be interesting to give it an
option to include ANALYZE for each table it's loaded among the tasks
that it schedules. (I'm visualizing these commands as being made up by
pg_restore itself, *not* added to the pg_dump output.) Then you could
have a reasonably optimal total workflow, whereas allowing autovacuum
to try to schedule the ANALYZEs can't be.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-09-17 14:59:13 Re: Common Table Expressions (WITH RECURSIVE) patch
Previous Message Tatsuo Ishii 2008-09-17 14:47:01 Re: Common Table Expressions (WITH RECURSIVE) patch