Skip site navigation (1) Skip section navigation (2)

Autovacuum & Table List Ordering

From: "Usama Dar" <munir(dot)usama(at)gmail(dot)com>
To: "pgsql-hackers list" <pgsql-hackers(at)postgresql(dot)org>
Subject: Autovacuum & Table List Ordering
Date: 2008-01-02 15:00:10
Message-ID: ff0e67090801020700p3d48c893wff24df2284436778@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
OK, so i was going through the autovacuum code and i noticed that when we
construct the table list to vacuum in a database per run, we don't process
them in a particular order. I mean since we pick the list up from pg_class
so it may be ordered on oid? but when we select a database we have a
priority  algo, which select the db's in XID wraparound  danger first, and
that too the in an order that the db nearest to the XID wraparound is picked
first

So wouldn't it make sense to pick up the tables in a similar order as well?
like sorting the list on (deadtuples - calculated threshold) this way we
will be vacuuming the tables in more need first.

Without an order i can imagine a scenario where a table which is near a
wrap-around or has more dead-rows waiting  or possible having the XID
warparound while another big table takes a lot of time.

With the launcher - worker architecture in 8.3 the situation will improve as
you can have multiple workers vacuuming multiple tables in parallel, but
having some order there would also help , i would think.

Thanks,
-- 
Usama Munir Dar http://www.linkedin.com/in/usamadar
Consultant Architect
Cell:+92 321 5020666
Skype: usamadar

Responses

pgsql-hackers by date

Next:From: Abraham, DannyDate: 2008-01-02 15:29:24
Subject: Slow count(*)
Previous:From: Martijn van OosterhoutDate: 2008-01-02 14:01:50
Subject: Re: Index Page Split logging

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group