472,102 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,102 software developers and data experts.

Showing disk usage of innodb tables?

Gh!
How can I see how much disk space is being occupied by an InnoDB table?

Looking into /var/lib/mysql doesn't seem to work anymore for InnoDB tables.

Please tell also if there is a way to see how much space is occupied by
a particular row or column of a table.

Thanks
Sep 28 '05 #1
1 5022
Gh! wrote:
How can I see how much disk space is being occupied by an InnoDB table?

Looking into /var/lib/mysql doesn't seem to work anymore for InnoDB tables.
The default configuration is for all InnoDB tables to share one
tablespace, which may consist of multiple files, but each table is
spread throughout the tablespace in a unpredictable manner.

Read this page in the docs:

http://dev.mysql.com/doc/mysql/en/in...ile-space.html

But you can also initialize the InnoDB tablespace to store each table in
a separate file.

Read this page in the docs:
http://dev.mysql.com/doc/mysql/en/mu...blespaces.html

This still doesn't tell you how much space is occupied by a given table,
because typically the files do not shrink, even if you delete a lot of
records. The space inside in marked as free -- i.e., available for
storing record versions created by future inserts or updates.

You can get a report of the free space in a tablespace with the SHOW
TABLE STATUS command (or mysqlshow --status databasename). If you use a
shared tablespace (the default), the report is for the whole shared
tablespace. If you use separate files for each InnoDB table, the report
is for the free space in the corresponding file.

Read this page in the docs:
http://dev.mysql.com/doc/mysql/en/sh...le-status.html
Please tell also if there is a way to see how much space is occupied by
a particular row or column of a table.


I don't know of a good way to get this information. You could create
another table and copy an individual row or column into it, and then get
space statistics on that table, but it might not match the space usage
of the original table precisely, because of differences in InnoDB file
fragmentation, etc.

Regards,
Bill K.
Sep 28 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Asif Iqbal | last post: by
reply views Thread by Lazy70 | last post: by
3 posts views Thread by Andy Tran | last post: by
2 posts views Thread by Jan | last post: by
reply views Thread by Mike Chirico | last post: by
3 posts views Thread by Reuben Pearse | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.