From: Igor Shevchenko <igor@carcass.ath.cx>
To: Scott Marlowe <smarlowe@g2switchworks.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: why vacuum
Date: Thu, 27 Oct 2005 04:34:58 +0300
Message-ID: <200510270434.58950.igor@carcass.ath.cx> (raw)
In-Reply-To: <1130337891.2872.8.camel@state.g2switchworks.com>
References: <200510261015.17623.lawgon@thenilgiris.com>
<1130337891.2872.8.camel@state.g2switchworks.com>
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
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-sql@postgresql.org
Cc: igor@carcass.ath.cx, smarlowe@g2switchworks.com
Subject: Re: why vacuum
In-Reply-To: <200510270434.58950.igor@carcass.ath.cx>
* 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