Re: autovacuum multiworkers, patch 5 - Mailing list pgsql-patches

From ITAGAKI Takahiro
Subject Re: autovacuum multiworkers, patch 5
Date
Msg-id 20070405092436.7B40.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Whole thread Raw
In response to autovacuum multiworkers, patch 5  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: autovacuum multiworkers, patch 5
List pgsql-patches
Alvaro Herrera <alvherre@commandprompt.com> wrote:

> Here is the autovacuum patch I am currently working with.  This is
> basically the same as the previous patch; I have tweaked the database
> list management so that after a change in databases (say a new database
> is created or a database is dropped), the list is recomputed to account
> for the change, keeping the ordering of the previous list.

I'm interested in your multiworkers autovacuum proposal.

I'm researching the impact of multiworkers with autovacuum_vacuum_cost_limit.
Autovacuum will consume server resources up to autovacuum_max_workers times
as many as before. I think we might need to change the semantics of
autovacuum_vacuum_cost_limit when we have multiworkers.


BTW, I found an unwitting mistake in the foreach_worker() macro.
These two operations are same in C.
  - worker + 1
  - (WorkerInfo *) (((char *) worker) + sizeof(WorkerInfo))


#define foreach_worker(_i, _worker) \
    _worker = (WorkerInfo *) (AutoVacuumShmem + \
                              offsetof(AutoVacuumShmemStruct, av_workers)); \
    for (_i = 0; _i < autovacuum_max_workers; _i++, _worker += sizeof(WorkerInfo))

should be:

#define foreach_worker(_worker) \
    for ((_worker) = AutoVacuumShmem->av_workers; \
        (_worker) < AutoVacuumShmem->av_workers + autovacuum_max_workers; \
        (_worker)++)

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center



pgsql-patches by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: HOT WIP Patch - version 6.3
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] --enable-xml instead of --with-libxml?