Re: why vacuum - Mailing list pgsql-sql

From Igor Shevchenko
Subject Re: why vacuum
Date
Msg-id 200510270434.58950.igor@carcass.ath.cx
Whole thread Raw
In response to Re: why vacuum  (Scott Marlowe <smarlowe@g2switchworks.com>)
List pgsql-sql
On Wednesday 26 October 2005 17:44, Scott Marlowe wrote:
> On Tue, 2005-10-25 at 23:45, Kenneth Gonsalves wrote:
> > hi,
> > i was in a minor flame war with a mysql guy - his major grouse was that
> > 'I wouldnt commit mission critical data to a database that needs to be
> > vacuumed once a week'. So why does pg need vacuum?
>
> The absolutely funniest thing about what this guy is saying is that he
> seems rather ignorant of the behaviour of innodb tables.  They have
> another name for the vacuum command there.  It's:
>
> ALTER TABLE tbl_name ENGINE=INNODB
>
> Which rebuilds the whole fraggin's table, with an exclusive lock.
>
> and guess what innodb does if you don't run this command every so often?
>
> Can you guess yet?  Yep, that's right, it just keeps growing and growing
> and growing.

Not quite so.

I'm running quite a few (>50) mysql/innodb servers with database sizes raging 
from 500mb to 50gb, and I never had to rebuild any innodb tables this way. 
InnoDB uses index-based data storage and rollback segments, which makes it 
harder to add bloat to their databases, as compared to PG (but autovacuum is 
my saviour). Innodb will actually free space when you do DELETE or TRUNCATE, 
but still, it's tables, indexes and tablespaces will get fragmented. This 
gets worse over time, but it had never been a big problem for me. My 
databases do 50 queries/second on average, 24/7. Note - all of this can be 
due to my access and data change patterns; YMMV. The "only" cleanup operation 
I do is CHECK/OPTIMIZE, on monthly basis; it's not much better than old PG's 
VACUUM, as it brings mysql/innodb's performance down by 5x-10x times; same 
goes for almost any long-running query.

I'm moving those servers to PG, due to this (concurrency) and other reasons. 
My top 3 reasons are: a much better concurrency (even with bg vacuums 
running :-), a much better planner, and PG's rich feature set.

-- 
Best Regards,
Igor Shevchenko


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Yes, pg does triggers first before asserting check constraints! Was Re: why vacuum
Next
From: "padmanabha konkodi"
Date:
Subject: handling money type