mysql查看数据及索引所占的空间

mysql查看数据及索引所占的空间

– 查询数据占用空间

SELECT
	CONCAT(
		ROUND(
			SUM(data_length) / (1024 * 1024 * 1024),
			6
		),
		' GB'
	) AS 'Total Data Size'
FROM
	information_schema. TABLES
WHERE
	table_schema LIKE 'crmdbcs';

– 查询索引占用空间

SELECT
	CONCAT(
		ROUND(
			SUM(index_length) / (1024 * 1024 * 1024),
			6
		),
		' GB'
	) AS 'Total Index Size'
FROM
	information_schema. TABLES
WHERE
	table_schema LIKE 'crmdbcs';
发布了10 篇原创文章 · 获赞 0 · 访问量 3857

猜你喜欢

转载自blog.csdn.net/weixin_43444783/article/details/91546766
今日推荐