From: Dimitri <dimitrik.fr@gmail.com>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Parallel Vacuum
Date: Thu, 22 Mar 2007 16:55:02 +0100
Message-ID: <200703221655.03068.dimitrik.fr@gmail.com> (raw)
In-Reply-To: <20070322151243.GH4102@alvh.no-ip.org>
References: <200703221435.54408.dimitrik.fr@gmail.com>
<200703221605.38460.dimitrik.fr@gmail.com>
<20070322151243.GH4102@alvh.no-ip.org>
On Thursday 22 March 2007 16:12, Alvaro Herrera wrote:
> Dimitri escribió:
> > On Thursday 22 March 2007 14:52, Alvaro Herrera wrote:
> > > Dimitri escribió:
> > > > Folks,
> > > >
> > > > is there any constrains/problems/etc. to run several vacuum processes
> > > > in parallel while each one is 'vaccuming' one different table?
> > >
> > > No, no problem. Keep in mind that if one of them takes a very long
> > > time, the others will not be able to remove dead tuples that were
> > > killed while the long vacuum was running -- unless you are in 8.2.
> >
> > Yes, I'm using the last 8.2.3 version. So, will they *really* processing
> > in parallel, or will block each other step by step?
>
> They won't block.
Wow! Excellent! :)
So, in this case why not to add 'parallel' option integrated directly into
the 'vacuumdb' command?
In my case I have several CPU on the server and quite powerful storage box
which is not really busy with a single vacuum. So, my idea is quite simple -
speed-up vacuum with parallel execution (just an algorithm):
--------------------------------------------------------------------------
PLL=parallel_degree
select tab_size, tabname, dbname from ... order by tab_size desc;
vacuumdb -d $dbname -t $tabname 2>&1 > /tmp/vac.$dbname.$tabname.log &
while (pgrep vacuumdb | wc -l ) >= $PLL
sleep 1
end
end
wait
--------------------------------------------------------------------------
biggest tables are vacuumed first, etc.
But of course it will be much more cool to have something like:
vacuumdb -a -P parallel_degree
What do you think? ;)
Rgds,
-Dimitri
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: dimitrik.fr@gmail.com, alvherre@commandprompt.com
Subject: Re: Parallel Vacuum
In-Reply-To: <200703221655.03068.dimitrik.fr@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox