Thread: vacuum in pg9beta4 much slower than in 8.4

vacuum in pg9beta4 much slower than in 8.4

From
Mario Splivalo
Date:
I think this is ok, but I'd just like a confirmation.

I have a db cluster with 6 databases, totaling around 6 GB of data.

In postgres 8.4 subsequent runs of 'vacuumdb -afvz' takes around 55
seconds (average from 10 runs). 'vacuumdb -avz' takes around 40 seconds
(average from 10 runs).

However, in postgres 9.0beta4, 'vacuumdb -avz' takes around 2 minutes
(average from 10 runs), and 'vacuumdb -afvz' takes around 12 minutes
(average from 4 runs).

I understand that VACUUM FULL in 9.0 copies all the data, but is it OK
that plain vacuum in 9.0 is slower than in 8.4?

    Mike

Re: vacuum in pg9beta4 much slower than in 8.4

From
Greg Smith
Date:
Mario Splivalo wrote:
> I understand that VACUUM FULL in 9.0 copies all the data, but is it OK
> that plain vacuum in 9.0 is slower than in 8.4?

It should be faster for tables with a lot of junk in them, but the new
VACUUM FULL is likely to be slower for ones that are already clean.
Note that one thing to be aware of is that depending on where you got
your 9.0 from, it may be compiled with debugging and assertion calls
that can slow certain operations down quite a bit.  If you try this at a
command prompt:

postgres=# show debug_assertions;
 debug_assertions
------------------
 on

And that's on, you can expect that copy of 9.0 to be significantly
slower at a number of things than a similar 8.4.

--
Greg Smith  2ndQuadrant US  Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com   www.2ndQuadrant.us


Re: vacuum in pg9beta4 much slower than in 8.4

From
Mario Splivalo
Date:
On 08/16/2010 08:44 AM, Greg Smith wrote:
> Mario Splivalo wrote:
>> I understand that VACUUM FULL in 9.0 copies all the data, but is it OK
>> that plain vacuum in 9.0 is slower than in 8.4?
>
> It should be faster for tables with a lot of junk in them, but the new
> VACUUM FULL is likely to be slower for ones that are already clean.
> Note that one thing to be aware of is that depending on where you got
> your 9.0 from, it may be compiled with debugging and assertion calls
> that can slow certain operations down quite a bit.  If you try this at a
> command prompt:
>
> postgres=# show debug_assertions;
> debug_assertions
> ------------------
> on
>
> And that's on, you can expect that copy of 9.0 to be significantly
> slower at a number of things than a similar 8.4.

I downloaded source and compiled it myself, this is excerpt from the
config.log:

enable_debug='no'
enable_dtrace='no'
enable_nls='no'
enable_profiling='no'

postgres=# show debug_assertions;
 debug_assertions
------------------
 off
(1 row)


Yes, I run the tests on clean tables. I run VACUUM FULL, and after that
I mesured how long it takes for VACUUM ANALYZE and VACUUM ANALYZE FULL.
So, it is ok for VACUUM FULL (on clean tables) on 9.0b4 to be six times
slower than on 8.4. But is it ok for plain VACUUM to be two times slower?

    Mike

Re: vacuum in pg9beta4 much slower than in 8.4

From
Josh Berkus
Date:
> Yes, I run the tests on clean tables. I run VACUUM FULL, and after that
> I mesured how long it takes for VACUUM ANALYZE and VACUUM ANALYZE FULL.
> So, it is ok for VACUUM FULL (on clean tables) on 9.0b4 to be six times
> slower than on 8.4. But is it ok for plain VACUUM to be two times slower?

On clean or on dirty tables?

--
                                   -- Josh Berkus
                                      PostgreSQL Experts Inc.
                                      http://www.pgexperts.com