All,

the VACUUM in PostgreSQL removes delete-marked records from the database.

In InnoDB, the VACUUM is called the purge. In InnoDB purge happens
automatically in the background, the user does not need to explicitly run
VACUUM, like in PostgreSQL. Also in Oracle purge is automatic.

The way to compact, reorganize, or optimize, an InnoDB table is to run

ALTER TABLE tablename TYPE=InnoDB;

It rebuilds the table.

The command

ANALYZE TABLE tablename;

in InnoDB updates the table statistics for the SQL optimizer. InnoDB
constantly updates the row count estimate, but only updates the index
cardinality estimates for join optimization at a mysqld startup, or when
ANALYZE TABLE is called. This is similar to MyISAM. But remember that in
InnoDB the estimates are not precise, but based on 8 random dives into the
index trees.

Best regards,

Heikki
Innobase Oy
http://www.innodb.com
InnoDB - transactions, row level locking, and foreign keys for MySQL
InnoDB Hot Backup - hot backup tool for InnoDB which also backs up MyISAM
tables

....................
From: Chris Nolan ([EMAIL PROTECTED])
Subject: Re: Optimizing table (so-called VACUUM on postgreSQL) and InnoDB
View: Complete Thread (3 articles)
Original Format
Newsgroups: mailing.database.myodbc
Date: 2003-10-24 00:35:58 PST

VACUUM is basically a workalike for:

ALTER TABLE <table_name> TYPE=3DInnoDB;

There are various types of VACUUM commands as well. VACUUM FULL basically
locks the table and shrinks the on-disk table space. The normal "VACUUM"
(normal since 7.2 I think), does not lock the table (similar to REORGANISE
in some other databases, while REORGANISE in some databases like SQLBase
REORGANISE locks everything) but does a basic defrag.

Hope this helps!

Regards,

Chris

On Fri, 24 Oct 2003 05:23 pm, Jeremy Zawodny wrote:
> On Thu, Oct 16, 2003 at 05:13:58PM -0300, Leonardo Rodrigues wrote:
> > Hello all,
> >
> > The referencial integrity control don=B4t apply to a simple table, do
> > it?
>
> What's a "simple" table?
>
> > My DB is growing, and growing, and I=B4m very concerned about my host
> > limitions of disk usage. So...
>
> You should be!
>
> > Another question: postgreeSQL has a SQL command called VACUUM, which
> > optimize and reduce the table=B4s used space disk. I discover for mySQL=
the
> > commands "OPTIMIZE TABLE" and "ANALYZE TABLE", but both don=B4t run on
> > InnoDB.
>
> ANALYZE table runs on InnoDB.
>
> > My question are: are these commands similar to VACUUM? What=B4s the
> > difference? How can I run on InnoDB?
>
> I don't know much about PostgreSQL, so I'm not sure.  If you describe
> what VACUUM does, I may be able to help explain how to do the same
> thing with MySQL.
>
> Jeremy
> --
> Jeremy D. Zawodny     |  Perl, Web, MySQL, Linux Magazine, Yahoo!
> <[EMAIL PROTECTED]>  |  http://jeremy.zawodny.com/
>
> MySQL 4.0.15-Yahoo-SMP: up 40 days, processed 1,530,867,850 queries
> (439/sec. avg)


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to