简体   繁体   English

MySQL NDB引擎上的Blob存储

[英]Blob storage on MySQL NDB engine

This is blob storage on ndb as per documentation. 根据文档,这是ndb上的Blob存储。 I want to see if converting blob to varbinary(large value) saves space. 我想看看是否将blob转换为varbinary(大值)可以节省空间。 But there are places in documentation that says large varbinary is treated same as Blob. 但是文档中有些地方说大型varbinary与Blob一样。 Is that right in case of ndb? 如果是ndb,是这样吗?

https://dev.mysql.com/doc/refman/5.6/en/storage-requirements.html https://dev.mysql.com/doc/refman/5.6/zh-CN/storage-requirements.html

The NDB storage engine supports variable-width columns. NDB存储引擎支持可变宽度的列。 This means that a VARCHAR column in an NDB Cluster table requires the same amount of storage as would any other storage engine, with the exception that such values are 4-byte aligned. 这意味着NDB群集表中的VARCHAR列所需的存储量与任何其他存储引擎相同,但这些值是4字节对齐的。 Thus, the string 'abcd' stored in a VARCHAR(50) column using the latin1 character set requires 8 bytes (rather than 5 bytes for the same column value in a MyISAM table). 因此,使用latin1字符集存储在VARCHAR(50)列中的字符串“ abcd”需要8个字节(对于MyISAM表中的同一列值,则需要5个字节)。

TEXT and BLOB columns are implemented differently in the NDB storage engine, wherein each row in a TEXT column is made up of two separate parts. TEXT和BLOB列在NDB存储引擎中的实现方式有所不同,其中TEXT列中的每一行都由两个单独的部分组成。 One of these is of fixed size (256 bytes), and is actually stored in the original table. 其中之一具有固定大小(256字节),并且实际上存储在原始表中。 The other consists of any data in excess of 256 bytes, which is stored in a hidden table. 另一个包含超过256个字节的任何数据,这些数据存储在隐藏表中。 The rows in this second table are always 2,000 bytes long. 第二个表中的行始终为2,000个字节长。 This means that the size of a TEXT column is 256 if size <= 256 (where size represents the size of the row); 这意味着如果size <= 256(其中size表示行的大小),则TEXT列的大小为256; otherwise, the size is 256 + size + (2000 * (size - 256) % 2000). 否则,大小为256 +大小+(2000 *(大小-256)%2000)。

All variants of BLOBs are handled the same way in NDB. BLOB的所有变体在NDB中的处理方式相同。 So answer is yes. 所以答案是肯定的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM