List:General Discussion« Previous MessageNext Message »
From:Michael Dykman Date:April 28 2009 3:55am
Subject:Re: size of database on disk
View as plain text  
> Hi,
>
> I'm using Mysql on Linux.
> How can I see the space a certain database is taking on disk ?
>

There are a number of factors to consider here.  If you are using a
recent version of MySQL such as might be shipped with a recent linux
distro, your default table types are likely using the innodb table
type.  (The mysql data still uses MyISAM tables but the space is
usually negligible)

In a typical setup, .all your InnoDb tables are stored in
pre-allocated extendt which can be found in your mysql data directory
in files names ibdataN, when N isan integer.. ie. ibdata1, ibdata2,
etc..

The initial size of the ibdata files depends on how your system is
configured.  On my development workstation, mine sits at 50M.  That
doesn't mean I"m storing 50M of actual data; it just means that I have
that much space allocated and that file is not going to grow until I
have filled it up.  As I only handle small amounts of data on this
machine, it may never grow.  HOwever, as you delete data, it is not
going to shrink either.

Probably, the metric you are looking for can be best appreciated by
logging into your database  through the console and issuing this
command:

SHOW TABLE STATUS;

I hope this helps.

--
 - michael dykman
 - mdykman@stripped

 - All models are wrong.  Some models are useful.
Thread
size of database on diskRandomcoder28 Apr
  • Re: size of database on diskMichael Dykman28 Apr
  • Re: size of database on diskewen fortune28 Apr