计算表中BLOB列的总数据大小 [英] Calculating total data size of BLOB column in a table

查看:111
本文介绍了计算表中BLOB列的总数据大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表,其中的一列中包含大量BLOB数据.我正在编写一个实用程序以将数据转储到文件系统.但是在转储之前,我需要检查磁盘上是否有必要的空间来导出整个表中的所有Blob字段.

请提出一种有效的方法来获取表中所有blob字段的大小.

解决方案

您可以使用MySQL函数OCTET_LENGTH(your_column_name).有关更多详细信息,请参见此处. /p>

I have a table with large amounts of BLOB data in a column. I am writing a utility to dump the data to file system. But before dumping, I need to check if necessary space is available on the disk to export all the blob fields throughout the table.

Please suggest an efficient approach to get size of all the blob fields in the table.

解决方案

You can use the MySQL function OCTET_LENGTH(your_column_name). See here for more details.

这篇关于计算表中BLOB列的总数据大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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