如何获取以GB为单位的mysql表大小 [英] how to get mysql table size in GB

查看:129
本文介绍了如何获取以GB为单位的mysql表大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最后通过以下查询计算出MySQL表的大小(以GB为单位).

Just ended up with calculating the size of MySQL table in GB with the following query.

选择(data_length + index_length)/power(1024,3)tablesize_gb FROM information_schema.tables,其中table_schema ='db'和 table_name ='tablename'

SELECT (data_length+index_length)/power(1024,3) tablesize_gb FROM information_schema.tables WHERE table_schema='db' and table_name='tablename'

是否可以获得以GB为单位的MySQL行的大小.

Is it possible to get the size of a MySQL row in GB.

或者如何获取表的平均行大小(以GB为单位).

Or how to get the avg row size for the table in GB.

推荐答案

要获取平均行长(包括开销),请使用

To get the average row length (including overhead), use the AVG_ROW_LENGTH column in information_schema.tables.

据我所知,无法计算MySQL中单个特定行的确切实际大小.

As far as I'm aware, there's no way to calculate the exact actual size of a single, specific row in MySQL.

这篇关于如何获取以GB为单位的mysql表大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆